<?php
//获取表前缀
$prefix = longbing_get_prefix();

//每个一个sql语句结束，都必须以英文分号结束。因为在执行sql时，需要分割单个脚本执行。
//表前缀需要自己添加{$prefix} 以下脚本被测试脚本

//@ioncube.dk myk("sha256", "random5676u71113r40011") -> "5277be6f3490a79791b53e40943429dec4313cb42ee7a29b9b6766ae3d886966" RANDOM
$sql = <<<updateSql

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_address` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_name` varchar(64) DEFAULT '',
  `mobile` varchar(32) DEFAULT '',
  `province` varchar(64) DEFAULT '',
  `city` varchar(64) DEFAULT '',
  `area` varchar(64) DEFAULT '',
  `status` tinyint(3) DEFAULT '0',
  `lng` varchar(64) DEFAULT '0',
  `lat` varchar(64) DEFAULT '0',
  `address` varchar(255) DEFAULT '',
  `top` int(11) DEFAULT '0',
  `create_time` int(11) DEFAULT '0',
  `address_info` varchar(625) DEFAULT '',
  `user_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;




CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_balance_card` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT '' COMMENT '标题',
  `price` double(10,2) DEFAULT '0.00' COMMENT '售卖价格',
  `true_price` double(10,2) DEFAULT '0.00' COMMENT '实际价格',
  `top` int(11) DEFAULT '0',
  `status` int(11) DEFAULT '1',
  `create_time` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_balance_order_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `order_code` varchar(255) DEFAULT '',
  `transaction_id` varchar(255) DEFAULT '',
  `pay_price` double(10,2) DEFAULT '0.00',
  `sale_price` double(10,2) DEFAULT '0.00',
  `true_price` double(10,2) DEFAULT '0.00',
  `create_time` bigint(12) DEFAULT '0',
  `pay_time` bigint(12) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  `title` varchar(255) DEFAULT '',
  `card_id` int(11) DEFAULT '0',
  `now_balance` double(10,2) DEFAULT '0.00' COMMENT '当前余额',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;







CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_balance_refund_order` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `order_code` varchar(255) DEFAULT '',
  `transaction_id` varchar(255) DEFAULT '',
  `card_id` int(11) DEFAULT '0',
  `order_id` int(11) DEFAULT '0',
  `apply_price` double(10,2) DEFAULT '0.00',
  `refund_price` double(10,2) DEFAULT '0.00',
  `title` varchar(255) DEFAULT '',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  `sh_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;





CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_balance_water` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `order_id` int(11) DEFAULT '0',
  `type` int(11) DEFAULT '1' COMMENT '1充值,2消费',
  `add` tinyint(3) DEFAULT '0',
  `price` double(10,2) DEFAULT '0.00' COMMENT '多少钱',
  `create_time` bigint(12) DEFAULT '0',
  `before_balance` double(10,2) DEFAULT '0.00',
  `after_balance` double(10,2) DEFAULT '0.00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_banner` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `img` varchar(128) DEFAULT '',
  `top` int(11) DEFAULT '1',
  `link` varchar(255) DEFAULT '',
  `status` tinyint(3) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_car` (
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `coach_id` int(11) DEFAULT '0',
  `service_id` int(11) DEFAULT '0',
  `num` int(11) DEFAULT '1',
  `status` tinyint(3) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_car_price` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `distance_free` double(11,2) DEFAULT '0.00' COMMENT '多少公里免费',
  `start_price` double(10,2) DEFAULT '9.00' COMMENT '起步价',
  `start_distance` double(10,2) DEFAULT '9.00' COMMENT '起步距离',
  `distance_price` double(10,2) DEFAULT '1.90' COMMENT '每公里多少钱',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_coach_collect` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `coach_id` int(11) DEFAULT '0',
  `create_time` bigint(12) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_coach_level` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT '',
  `time_long` int(11) DEFAULT '0',
  `status` int(11) DEFAULT '1',
  `create_time` bigint(12) DEFAULT '0',
  `balance` int(11) DEFAULT '0' COMMENT '抽成比例',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_coach_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `coach_name` varchar(255) DEFAULT '' COMMENT '名称',
  `user_id` int(11) DEFAULT NULL,
  `mobile` varchar(255) DEFAULT '',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  `sex` tinyint(3) DEFAULT '0' COMMENT '性别',
  `work_time` bigint(12) DEFAULT '0' COMMENT '从业年份',
  `city` varchar(255) DEFAULT '' COMMENT '城市',
  `lng` varchar(255) DEFAULT '',
  `lat` varchar(255) DEFAULT '',
  `address` varchar(625) DEFAULT '' COMMENT '详细地址',
  `text` varchar(625) DEFAULT '' COMMENT '简介',
  `id_card` varchar(625) DEFAULT '',
  `license` varchar(625) DEFAULT '' COMMENT '执照',
  `work_img` varchar(255) DEFAULT '' COMMENT '工作照',
  `self_img` text COMMENT '个人照片',
  `is_work` tinyint(3) DEFAULT '1' COMMENT '是否工作',
  `start_time` varchar(32) DEFAULT '',
  `end_time` varchar(32) DEFAULT '',
  `service_price` double(10,2) DEFAULT '0.00',
  `car_price` double(10,2) DEFAULT '0.00',
  `id_code` varchar(255) DEFAULT '',
  `sh_text` varchar(1024) DEFAULT '',
  `sh_time` bigint(11) DEFAULT '0',
  `star` double(10,1) DEFAULT '5.0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_coach_police` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `coach_id` int(11) DEFAULT '0',
  `user_id` int(11) DEFAULT '0',
  `text` varchar(1024) DEFAULT '',
  `create_time` bigint(11) DEFAULT '0',
  `have_look` tinyint(3) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_comment_lable` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `comment_id` int(11) DEFAULT '0',
  `lable_id` int(11) DEFAULT NULL,
  `lable_title` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_coupon` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT '' COMMENT '名称',
  `type` tinyint(3) DEFAULT '0',
  `full` double(10,2) DEFAULT NULL COMMENT '满多少',
  `discount` double(10,2) DEFAULT NULL COMMENT '减多少',
  `rule` text COMMENT '规则',
  `text` text COMMENT '详情',
  `send_type` tinyint(3) DEFAULT '0' COMMENT '派发方式',
  `time_limit` tinyint(3) DEFAULT '0' COMMENT '时间限制',
  `start_time` bigint(12) DEFAULT '0',
  `end_time` bigint(12) DEFAULT '0',
  `day` int(11) DEFAULT '0' COMMENT '有效期',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(12) DEFAULT '0',
  `top` int(11) DEFAULT '0',
  `stock` int(11) DEFAULT '0' COMMENT '库存',
  `have_send` int(11) DEFAULT '0' COMMENT '已发多少张',
  `i` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `{$prefix}shequshop_school_goods_sh_list` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `sh_id` int(11) DEFAULT '0' COMMENT '审核id',
  `goods_id` int(11) DEFAULT '0',
  `goods_name` varchar(255) DEFAULT '' COMMENT '商品列表',
  `cate_id` int(11) DEFAULT '0' COMMENT '分类id',
  `cover` varchar(255) DEFAULT '' COMMENT '封面图',
  `imgs` text COMMENT '轮播图',
  `text` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_coupon_atv` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `status` tinyint(3) DEFAULT '0',
  `start_time` bigint(12) DEFAULT '0',
  `end_time` bigint(12) DEFAULT '0',
  `inv_user_num` int(11) DEFAULT '0' COMMENT '邀请好友数量',
  `inv_time` int(11) DEFAULT '0' COMMENT '邀请有效期',
  `atv_num` int(11) DEFAULT '0' COMMENT '发起活动次数',
  `inv_user` int(11) DEFAULT '0' COMMENT '邀请人',
  `to_inv_user` int(11) DEFAULT '0' COMMENT '被邀请人',
  `share_img` varchar(625) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_coupon_atv_coupon` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `atv_id` int(11) DEFAULT '0',
  `coupon_id` int(11) DEFAULT '0',
  `num` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_coupon_atv_record` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `atv_id` int(11) DEFAULT '0' COMMENT '目前只有一个活动,没有什么用',
  `atv_start_time` bigint(11) DEFAULT '0',
  `atv_end_time` bigint(11) DEFAULT NULL,
  `inv_user_num` int(11) DEFAULT '0' COMMENT '邀请好友数量',
  `inv_time` int(11) DEFAULT '0' COMMENT '有效期',
  `end_time` bigint(11) DEFAULT '0',
  `start_time` bigint(11) DEFAULT '0',
  `inv_user` tinyint(3) DEFAULT '0',
  `to_inv_user` tinyint(3) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  `num` int(11) DEFAULT '1',
  `share_img` varchar(625) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_coupon_atv_record_coupon` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `atv_id` int(11) DEFAULT '0',
  `record_id` int(11) DEFAULT '0' COMMENT '发起的活动id',
  `coupon_id` int(11) DEFAULT '0' COMMENT '优惠券id',
  `num` int(11) DEFAULT '1' COMMENT '张数',
  `status` int(11) DEFAULT '1',
  `success_num` int(11) DEFAULT '0' COMMENT '已发多少张',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_coupon_atv_record_list` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `record_id` int(11) DEFAULT '0',
  `user_id` int(11) DEFAULT '0' COMMENT '发起人',
  `to_inv_id` int(11) DEFAULT '0' COMMENT '被邀请人',
  `create_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_coupon_goods` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT '0',
  `coupon_id` int(11) DEFAULT '0',
  `goods_id` int(11) DEFAULT '0',
  `type` int(11) DEFAULT '0' COMMENT '0平台，用户领取',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_coupon_record` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `coupon_id` int(11) DEFAULT '0',
  `title` varchar(225) DEFAULT '',
  `type` int(11) DEFAULT '0',
  `full` double(10,2) DEFAULT '0.00',
  `discount` double(10,2) DEFAULT '0.00',
  `start_time` bigint(12) DEFAULT '0',
  `end_time` bigint(13) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(12) DEFAULT '0',
  `num` int(11) DEFAULT '1',
  `use_time` bigint(11) DEFAULT '0',
  `order_id` int(11) DEFAULT '0',
  `pid` int(11) DEFAULT '0',
  `rule` text,
  `text` text,
  `is_show` tinyint(3) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_lable` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT '',
  `top` int(11) DEFAULT '0',
  `create_time` bigint(11) DEFAULT '0',
  `status` int(11) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_order_address` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_id` int(11) DEFAULT '0',
  `user_name` varchar(64) DEFAULT '',
  `mobile` varchar(32) DEFAULT '',
  `province` varchar(64) DEFAULT '',
  `city` varchar(64) DEFAULT '',
  `area` varchar(64) DEFAULT '',
  `lng` varchar(32) DEFAULT '0',
  `lat` varchar(32) DEFAULT '0',
  `address` varchar(255) DEFAULT '',
  `address_info` varchar(625) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_order_comment` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `order_id` int(11) DEFAULT NULL,
  `star` int(255) DEFAULT '0',
  `text` varchar(625) DEFAULT '',
  `create_time` bigint(11) DEFAULT '0',
  `status` int(11) DEFAULT '1',
  `coach_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_order_goods_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `order_id` int(11) DEFAULT '0',
  `goods_id` int(11) DEFAULT '0' COMMENT '服务id',
  `goods_name` varchar(255) DEFAULT '' COMMENT '服务名称',
  `goods_cover` varchar(255) DEFAULT '' COMMENT '封面图',
  `price` double(10,2) DEFAULT '0.00',
  `num` int(11) DEFAULT '1' COMMENT '数量',
  `coach_id` int(11) DEFAULT '0',
  `time_long` int(11) DEFAULT '0',
  `can_refund_num` int(11) DEFAULT '0',
  `true_price` double(10,5) DEFAULT '0.00',
  `pay_type` tinyint(3) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_order_list` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT '0',
  `user_id` int(11) DEFAULT '0',
  `order_code` varchar(255) DEFAULT '' COMMENT '订单号',
  `pay_type` tinyint(3) DEFAULT '1',
  `transaction_id` varchar(64) DEFAULT '' COMMENT '商户订单号',
  `pay_price` decimal(10,2) DEFAULT '0.00',
  `car_price` double(10,2) DEFAULT '0.00' COMMENT '出行费用',
  `true_car_price` double(10,2) DEFAULT '0.00',
  `service_price` double(10,2) DEFAULT '0.00' COMMENT '服务费用',
  `true_service_price` double(10,2) DEFAULT '0.00',
  `coach_id` int(11) DEFAULT '0' COMMENT '服务技师',
  `start_time` bigint(12) DEFAULT '0',
  `end_time` bigint(12) DEFAULT '0',
  `time_long` int(11) DEFAULT '0' COMMENT '服务时长',
  `true_time_long` int(11) DEFAULT '0' COMMENT '真实服务时长出来退款的',
  `pay_time` bigint(12) DEFAULT '0',
  `create_time` bigint(12) DEFAULT '0',
  `text` varchar(625) DEFAULT '',
  `can_tx_time` int(11) DEFAULT '0',
  `can_tx_date` int(11) DEFAULT '0' COMMENT '可提现时间',
  `hx_user` int(11) DEFAULT '0' COMMENT '核销人',
  `have_tx` tinyint(3) DEFAULT '0',
  `balance` double(10,2) DEFAULT '0.00',
  `receiving_time` bigint(11) DEFAULT '0' COMMENT '接单时间',
  `serout_time` bigint(11) DEFAULT '0' COMMENT '出发时间',
  `arrive_time` bigint(11) DEFAULT '0' COMMENT '到达时间',
  `start_service_time` bigint(11) DEFAULT '0' COMMENT '开始服务时间',
  `arrive_img` varchar(625) DEFAULT '' COMMENT '到达拍照',
  `order_end_time` bigint(11) DEFAULT '0' COMMENT '订单核销时间',
  `is_comment` tinyint(3) DEFAULT '0',
  `distance` double(10,2) DEFAULT '0.00' COMMENT '距离',
  `car_type` tinyint(3) DEFAULT '0',
  `coach_refund_time` bigint(11) DEFAULT '0' COMMENT '拒绝接单',
  `coach_refund_code` varchar(64) DEFAULT '',
  `coupon_id` int(11) DEFAULT '0',
  `discount` double(10,2) DEFAULT '0.00' COMMENT '优惠金额',
  `init_service_price` double(10,2) DEFAULT '0.00',
  `over_time` bigint(11) DEFAULT '0',
  `is_show` tinyint(3) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_refund_order` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_code` varchar(64) DEFAULT '',
  `order_id` int(11) DEFAULT '0',
  `user_id` int(11) DEFAULT '0',
  `transaction_id` varchar(64) DEFAULT '',
  `coach_id` int(11) DEFAULT '0' COMMENT '教练',
  `pay_price` double(10,2) DEFAULT '0.00',
  `apply_price` double(10,2) DEFAULT '0.00',
  `refund_price` double(10,2) DEFAULT '0.00',
  `status` int(11) DEFAULT '1',
  `text` varchar(625) DEFAULT '',
  `refund_text` varchar(625) DEFAULT '',
  `create_time` bigint(12) DEFAULT '0',
  `refund_time` bigint(12) DEFAULT '0',
  `balance` double(10,2) DEFAULT '0.00',
  `cancel_time` bigint(11) DEFAULT '0',
  `out_refund_no` varchar(64) DEFAULT '',
  `imgs` varchar(1024) DEFAULT '',
  `car_price` double(10,2) DEFAULT '0.00',
  `time_long` int(11) DEFAULT '0' COMMENT '退款服务时长',
  `service_price` double(10,2) DEFAULT '0.00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_refund_order_goods` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `refund_id` int(11) DEFAULT '0',
  `goods_id` int(11) DEFAULT '0',
  `goods_name` varchar(255) DEFAULT '',
  `goods_cover` varchar(255) DEFAULT '',
  `goods_price` decimal(10,2) DEFAULT '0.00',
  `num` int(11) DEFAULT '1',
  `order_goods_id` int(11) DEFAULT '0',
  `order_id` int(11) DEFAULT '0',
  `status` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_service_coach` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `ser_id` int(11) DEFAULT '0' COMMENT '服务id',
  `coach_id` int(11) DEFAULT '0' COMMENT '教练id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_service_list` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT '' COMMENT '标题',
  `cover` varchar(255) DEFAULT '' COMMENT '封面图',
  `price` double(10,2) DEFAULT '0.00' COMMENT '价格',
  `sale` int(11) DEFAULT '0' COMMENT '销量',
  `true_sale` int(11) DEFAULT '0' COMMENT '实际销量',
  `total_sale` int(11) DEFAULT '0' COMMENT '总销量',
  `time_long` int(11) DEFAULT '0' COMMENT '服务时长',
  `max_time` int(11) DEFAULT '0' COMMENT '最长预约',
  `introduce` text COMMENT '介绍',
  `explain` text COMMENT '说明',
  `notice` text COMMENT '须知',
  `top` int(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  `star` double(10,2) DEFAULT '5.00',
  `imgs` text,
  `lock` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;




CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_user_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `openid` varchar(64) NOT NULL DEFAULT '',
  `nickName` varchar(255) CHARACTER SET utf8mb4 DEFAULT '',
  `avatarUrl` varchar(255) DEFAULT '',
  `create_time` bigint(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  `cap_id` int(11) DEFAULT '0',
  `city` varchar(255) DEFAULT '',
  `country` varchar(255) DEFAULT '',
  `gender` int(11) DEFAULT '0',
  `language` varchar(32) DEFAULT '',
  `province` varchar(128) DEFAULT '',
  `balance` double(10,2) DEFAULT '0.00' COMMENT '余额',
  `phone` varchar(32) DEFAULT '',
  `session_key` varchar(255) DEFAULT '',
  `pid` int(11) DEFAULT '0',
  `cash` double(10,2) DEFAULT '0.00' COMMENT '分销佣金',
  `unionid` varchar(64) DEFAULT '',
  `app_openid` varchar(64) DEFAULT '',
  `web_openid` varchar(64) DEFAULT '',
  `wechat_openid` varchar(64) DEFAULT '',
  `last_login_type` tinyint(3) DEFAULT '0' COMMENT '0小程序 1app 2web',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_wallet_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `code` varchar(255) DEFAULT '',
  `user_id` int(11) DEFAULT '0',
  `coach_id` int(11) DEFAULT NULL,
  `total_price` double(10,2) DEFAULT '0.00' COMMENT '总代提现多少',
  `apply_price` double(10,2) DEFAULT '0.00',
  `service_price` double(10,2) DEFAULT '0.00' COMMENT '手续费',
  `balance` int(11) DEFAULT '0' COMMENT '提成比例',
  `true_price` double(10,2) DEFAULT '0.00' COMMENT '实际到账',
  `status` int(11) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '11',
  `sh_time` bigint(11) DEFAULT '0',
  `type` tinyint(3) DEFAULT '0' COMMENT '1是车费',
  `online` tinyint(3) DEFAULT '0',
  `payment_no` varchar(64) DEFAULT '',
  `text` varchar(1024) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}shequshop_school_admin` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `username` varchar(255) DEFAULT '',
  `passwd` varchar(255) DEFAULT '',
  `create_time` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}shequshop_school_attachment` (
 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(10) unsigned NOT NULL,
  `uid` int(10) unsigned NOT NULL,
  `filename` varchar(255) NOT NULL,
  `attachment` varchar(255) NOT NULL,
  `type` tinyint(3) unsigned NOT NULL,
  `createtime` int(10) unsigned NOT NULL,
  `module_upload_dir` varchar(100) DEFAULT NULL,
  `group_id` int(11) DEFAULT NULL,
  `longbing_attachment_path` char(255) NOT NULL DEFAULT '' COMMENT 'path',
  `longbing_driver` char(10) NOT NULL DEFAULT '' COMMENT 'loacl',
  `longbing_from` varchar(255) NOT NULL DEFAULT '' COMMENT 'web',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}shequshop_school_attachment_group` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(25) NOT NULL,
  `uniacid` int(11) DEFAULT NULL,
  `uid` int(11) DEFAULT '0',
  `type` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}shequshop_school_config` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `appid` varchar(32) DEFAULT '',
  `appsecret` varchar(64) DEFAULT '',
  `app_name` varchar(255) DEFAULT '',
  `over_time` int(11) DEFAULT '300' COMMENT '订单超时取消',
  `cash_balance` int(11) DEFAULT '100' COMMENT ' 提现比列',
  `min_cash` double(10,2) DEFAULT '0.00' COMMENT '最低提现金额',
  `max_day` int(11) DEFAULT '7' COMMENT '最长预约时间',
  `time_unit` int(11) DEFAULT '30' COMMENT '时长单位',
  `service_cover_time` int(11) DEFAULT '0' COMMENT '服务倒计时',
  `can_tx_time` int(11) DEFAULT '24' COMMENT '多少小时后可提现',
  `cash_mini` double(10,2) DEFAULT '0.01',
  `mobile` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}shequshop_school_oos_config` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) NOT NULL DEFAULT '0',
  `status` tinyint(4) NOT NULL DEFAULT '1',
  `miniapp_name` varchar(50) NOT NULL DEFAULT '',
  `open_oss` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0-本地 1-阿里云 2-七牛云  3--腾讯云',
  `aliyun_bucket` varchar(255) NOT NULL DEFAULT '' COMMENT '仓库',
  `aliyun_access_key_id` varchar(50) NOT NULL DEFAULT '' COMMENT '阿里云',
  `aliyun_access_key_secret` varchar(100) NOT NULL DEFAULT '' COMMENT '阿里云',
  `aliyun_base_dir` varchar(200) NOT NULL DEFAULT '' COMMENT '图片等资源存储根目录',
  `aliyun_zidinyi_yuming` varchar(255) NOT NULL DEFAULT '' COMMENT '自定义域名',
  `aliyun_endpoint` varchar(255) NOT NULL DEFAULT '',
  `aliyun_rules` text COMMENT '阿里云的规则配置',
  `qiniu_accesskey` varchar(100) NOT NULL DEFAULT '' COMMENT '七牛云秘钥',
  `qiniu_secretkey` varchar(100) NOT NULL DEFAULT '' COMMENT '七牛云秘钥',
  `qiniu_bucket` varchar(50) NOT NULL DEFAULT '' COMMENT '七牛云仓库',
  `qiniu_yuming` varchar(255) NOT NULL DEFAULT '' COMMENT '七牛自定义域名  前面要加http://',
  `qiniu_rules` text COMMENT '七牛的规则配置',
  `tenxunyun_appid` varchar(20) NOT NULL DEFAULT '' COMMENT '腾讯云的appid',
  `tenxunyun_secretid` varchar(50) NOT NULL DEFAULT '' COMMENT '腾讯云secretid',
  `tenxunyun_secretkey` varchar(50) NOT NULL DEFAULT '' COMMENT '腾讯云的配置',
  `tenxunyun_bucket` varchar(50) NOT NULL DEFAULT '' COMMENT '腾讯云图片仓库',
  `tenxunyun_region` varchar(50) NOT NULL DEFAULT '' COMMENT '腾讯云地域',
  `tenxunyun_yuming` varchar(300) NOT NULL DEFAULT '' COMMENT '腾讯云域名',
  `apiclient_cert` varchar(200) NOT NULL DEFAULT '',
  `apiclient_key` varchar(200) NOT NULL DEFAULT '' COMMENT '两个证书文件路径',
  `create_time` int(11) NOT NULL DEFAULT '0',
  `update_time` int(11) NOT NULL DEFAULT '0',
  `delete_time` int(11) DEFAULT NULL COMMENT '删除时间',
  `deleted` tinyint(1) NOT NULL DEFAULT '0',
  `is_sync` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否同步',
  `name` varchar(64) NOT NULL DEFAULT '' COMMENT '储蓄名字',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}shequshop_school_pay_config` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `uniacid` int(10) NOT NULL DEFAULT '0' COMMENT '小程序关联id',
  `mch_id` varchar(255) NOT NULL DEFAULT '' COMMENT '商户号',
  `pay_key` varchar(255) NOT NULL DEFAULT '' COMMENT '支付秘钥',
  `cert_path` varchar(255) NOT NULL DEFAULT '' COMMENT '证书',
  `key_path` varchar(255) NOT NULL DEFAULT '' COMMENT '证书',
  `min_price` int(6) NOT NULL DEFAULT '0' COMMENT '最低提现金额',
  `pay_name` varchar(255) NOT NULL DEFAULT 'wechat' COMMENT '支付类型',
  `create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}shequshop_school_wechat_code` (
`id` char(32) NOT NULL DEFAULT '',
  `uniacid` int(11) NOT NULL DEFAULT '0' COMMENT 'uniacid',
  `data` text COMMENT '数据',
  `create_time` int(11) DEFAULT NULL COMMENT '创建时间',
  `update_time` int(11) DEFAULT NULL COMMENT '更新时间',
  `delete_time` int(11) DEFAULT NULL COMMENT '删除时间',
  `deleted` tinyint(1) DEFAULT '0' COMMENT '1：已回收；0：可用；',
  `path` varchar(500) DEFAULT '',
  `count` int(11) DEFAULT '0' COMMENT '扫码次数',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_notice_list` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_id` int(11) DEFAULT '0',
  `have_look` tinyint(3) DEFAULT '0' COMMENT '是否被查看',
  `type` tinyint(3) DEFAULT '1' COMMENT '1是订单，2是退款',
  `create_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_printer` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `store_id` int(11) DEFAULT '0' COMMENT '门店id',
  `user` varchar(64) DEFAULT '0' COMMENT '用户id',
  `code` varchar(64) DEFAULT '0' COMMENT '终端号',
  `api_key` varchar(64) DEFAULT '0' COMMENT 'api_key',
  `printer_key` varchar(64) DEFAULT '0' COMMENT '打印机key',
  `type` int(11) DEFAULT '1' COMMENT '1:飞蛾 2:易联云',
  `user_ticket` int(11) DEFAULT '0' COMMENT '用户小票',
  `user_ticket_num` int(11) DEFAULT '1' COMMENT '用户小票联数',
  `kitchen_ticket` int(11) DEFAULT '0' COMMENT '后厨小票',
  `kitchen_ticket_num` int(11) DEFAULT '1' COMMENT '后厨小票联数',
  `status` int(11) DEFAULT '1',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `auto` int(11) DEFAULT '1' COMMENT '自动打印',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_cash_list` (
  `id` int(11) NOT NULL,
  `uniacid` int(11) DEFAULT NULL,
  `type` int(11) DEFAULT '1' COMMENT '1加盟商 2技师 3分销商',
  `user_id` int(11) DEFAULT '0',
  `cash` decimal(10,2) DEFAULT '0.00',
  `order_id` int(11) DEFAULT '0',
  `under_user` int(11) DEFAULT '0' COMMENT '来源',
  `status` int(11) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  `balance` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_city_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(64) DEFAULT '',
  `lng` varchar(32) DEFAULT '',
  `lat` varchar(32) DEFAULT '',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  `true_name` varchar(64) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;




CREATE TABLE IF NOT EXISTS `{$prefix}massage_distribution_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `user_name` varchar(32) CHARACTER SET utf8mb4 DEFAULT '',
  `mobile` varchar(32) DEFAULT '',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  `text` varchar(625) CHARACTER SET utf8mb4 DEFAULT '',
  `sh_text` varchar(625) DEFAULT '',
  `sh_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



ALTER TABLE `{$prefix}massage_service_service_list` ADD COLUMN  `init_price` double(10,2) DEFAULT '0.00' COMMENT '原价';

ALTER TABLE `{$prefix}massage_service_user_list` ADD COLUMN `pid` int(11) DEFAULT '0';

ALTER TABLE `{$prefix}massage_service_user_list` ADD COLUMN `cash` double(10,2) DEFAULT '0.00' COMMENT '分销佣金';

ALTER TABLE `{$prefix}massage_service_service_list` ADD COLUMN `com_balance` int(11) DEFAULT '0' COMMENT '分销比例';

ALTER TABLE `{$prefix}massage_service_service_list` ADD COLUMN `sub_title` varchar(255) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_coach_list` modify COLUMN `license` text COMMENT '执照';

ALTER TABLE `{$prefix}massage_action_log` modify COLUMN `obj_id` varchar(625) DEFAULT '';

ALTER TABLE `{$prefix}massage_send_msg_config` modify COLUMN `help_tmpl_id` varchar(225) DEFAULT '';

ALTER TABLE `{$prefix}massage_send_msg_config` modify COLUMN `order_tmp_id` varchar(225) DEFAULT '';

ALTER TABLE `{$prefix}massage_send_msg_config` modify COLUMN `cancel_tmp_id` varchar(225) DEFAULT '';

ALTER TABLE `{$prefix}massage_send_msg_config` modify COLUMN `coachupdate_tmp_id` varchar(225) DEFAULT '';




ALTER TABLE `{$prefix}massage_service_refund_order` modify COLUMN `text` varchar(625) CHARACTER SET utf8mb4 DEFAULT '';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `arr_address` varchar(225) DEFAULT '';


ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `arr_address` varchar(225) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `arr_lng` varchar(32) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `arr_lat` varchar(32) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `end_img` varchar(255) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `end_lng` varchar(32) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `end_lat` varchar(32) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `end_address` varchar(255) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `app_pay` int(11) DEFAULT '0';

ALTER TABLE `{$prefix}massage_service_coach_list` ADD COLUMN  `admin_add` tinyint(3) DEFAULT '0' COMMENT '是否是后台添加';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN  `im_type` int(11) DEFAULT '1';

ALTER TABLE `{$prefix}massage_service_user_list` ADD COLUMN  `unionid` varchar(64) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_user_list` ADD COLUMN  `app_openid` varchar(64) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_user_list` ADD COLUMN  `web_openid` varchar(64) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_user_list` ADD COLUMN  `wechat_openid` varchar(64) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_user_list` ADD COLUMN  `last_login_type` tinyint(3) DEFAULT '0' COMMENT '0小程序 1app 2web';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN  `app_app_secret` varchar(64) DEFAULT '';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN  `app_app_id` varchar(64) DEFAULT '';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN  `login_protocol` text CHARACTER SET utf8mb4;

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN  `web_app_secret` varchar(64) DEFAULT '';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN  `web_app_id` varchar(64) DEFAULT '';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN  `map_secret` varchar(64) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_balance_order_list` ADD COLUMN  `app_pay` tinyint(3) DEFAULT '0';

ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN  `is_admin` tinyint(3) DEFAULT '1' COMMENT '是否是超管';

ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN  `balance` int(11) DEFAULT '0' COMMENT '分佣比例';

ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN  `user_id` int(11) DEFAULT '0' COMMENT '绑定用户';

ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN  `status` tinyint(3) DEFAULT '1';

ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN  `passwd_text` varchar(255) DEFAULT '';

ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN  `cash` double(10,2) DEFAULT '0.00' COMMENT '佣金';

ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN  `lock` int(11) DEFAULT '0';

ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN  `phone` varchar(32) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN  `admin_id` int(11) DEFAULT '0' COMMENT '加盟商id';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN  `admin_balance` int(11) DEFAULT '0' COMMENT '加盟商佣金比例';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN  `admin_cash` decimal(10,2) DEFAULT '0.00' COMMENT '加盟商佣金';

ALTER TABLE `{$prefix}massage_service_coach_list` ADD COLUMN  `admin_id` int(11) DEFAULT '0' COMMENT '加盟商id';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN  `coach_balance` int(11) DEFAULT '0' COMMENT '技师佣金比例';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN  `coach_cash` decimal(10,2) DEFAULT '0.00' COMMENT '技师佣金';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN  `company_cash` decimal(10,2) DEFAULT '0.00' COMMENT '平台抽层';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN  `user_cash` decimal(10,2) DEFAULT '0.00' COMMENT '用户分销';

ALTER TABLE `{$prefix}massage_service_order_commission` ADD COLUMN `type` int(11) DEFAULT '1' COMMENT '1分销 2加盟商 3技师 4分销商';

ALTER TABLE `{$prefix}massage_service_order_commission` ADD COLUMN `balance` int(11) DEFAULT '0';

ALTER TABLE `{$prefix}massage_service_order_commission` ADD COLUMN `admin_id` int(11) DEFAULT '0' COMMENT '加盟商id';

ALTER TABLE `{$prefix}massage_service_wallet_list` ADD COLUMN `admin_id` int(11) DEFAULT '0';

ALTER TABLE `{$prefix}massage_service_refund_order` ADD COLUMN `admin_id` int(11) DEFAULT '0';

ALTER TABLE `{$prefix}massage_service_order_comment` ADD COLUMN `admin_id` int(11) DEFAULT '0';

ALTER TABLE `{$prefix}massage_service_user_list` ADD COLUMN `new_cash` decimal(10,2) DEFAULT '0.00' COMMENT '新的分销佣金可提现';

ALTER TABLE `{$prefix}massage_service_user_list` ADD COLUMN `lock` int(11) DEFAULT '0';

ALTER TABLE `{$prefix}massage_service_coupon` ADD COLUMN `user_limit` int(11) DEFAULT '1' COMMENT '1不限制 2新用户';

ALTER TABLE `{$prefix}massage_service_coach_list` ADD COLUMN `city_id` int(11) DEFAULT '0';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN `company_pay` tinyint(3) DEFAULT '1';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN `short_id` varchar(64) DEFAULT '';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN `short_secret` varchar(64) DEFAULT '';



ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN `fx_check` tinyint(3) DEFAULT '0' COMMENT '是否开启分销审核';

ALTER TABLE `{$prefix}massage_service_user_list` ADD COLUMN `is_fx` tinyint(3) DEFAULT '0';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN  `is_bus` tinyint(3) DEFAULT '1' COMMENT '是否支持公共交通';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN  `bus_start_time` varchar(32) DEFAULT '';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN  `bus_end_time` varchar(32) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_notice_list` ADD COLUMN  `admin_id` int(11) DEFAULT '0';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN  `app_text` varchar(64) DEFAULT '' COMMENT 'app名称';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN  `app_logo` varchar(255) DEFAULT '' COMMENT 'applogo';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN  `record_type` int(11) DEFAULT '1';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN  `record_no` varchar(255) DEFAULT '';



ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN  `trading_rules` text COMMENT '交易规则';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN  `user_image` varchar(255) DEFAULT '' COMMENT '个人中心背景图';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN  `user_font_color` varchar(32) DEFAULT '' COMMENT '文字颜色';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN  `coach_image` varchar(255) DEFAULT '' COMMENT '技师端背景图';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN  `coach_font_color` varchar(32) DEFAULT '' COMMENT '文字颜色';

ALTER TABLE `{$prefix}massage_service_coach_list` ADD COLUMN  `video` varchar(255) DEFAULT '' COMMENT '视频';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN  `channel_id` int(11) DEFAULT '0' COMMENT '渠道商';

ALTER TABLE `{$prefix}shequshop_school_config` modify COLUMN `user_image` varchar(255) DEFAULT 'https://lbqny.migugu.com/admin/anmo/mine/bg.png' COMMENT '个人中心背景图';

ALTER TABLE `{$prefix}shequshop_school_config` modify COLUMN `user_font_color` varchar(32) DEFAULT '#ffffff' COMMENT '文字颜色';

ALTER TABLE `{$prefix}shequshop_school_config` modify COLUMN `coach_image` varchar(255) DEFAULT 'https://lbqny.migugu.com/admin/anmo/mine/bg.png' COMMENT '技师端背景图';

ALTER TABLE `{$prefix}shequshop_school_config` modify COLUMN `coach_font_color` varchar(32) DEFAULT '#ffffff' COMMENT '文字颜色';

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_order_comment_goods` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `service_id` int(11) DEFAULT '0',
  `comment_id` int(11) DEFAULT '0',
  `star` decimal(10,2) DEFAULT '0.00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_wx_upload` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `key` varchar(625) DEFAULT '' COMMENT '密钥',
  `version` varchar(32) DEFAULT '' COMMENT '版本号',
  `content` varchar(1024) DEFAULT '' COMMENT '描述',
  `app_id` varchar(1024) DEFAULT '' COMMENT 'app_id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='微信上传配置';




CREATE TABLE IF NOT EXISTS `{$prefix}massage_channel_cate` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT '',
  `create_time` bigint(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='渠道商分类';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_channel_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `cate_id` int(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT NULL,
  `text` text CHARACTER SET utf8mb4,
  `sh_text` text CHARACTER SET utf8mb4,
  `sh_time` bigint(11) DEFAULT '0',
  `user_name` varchar(255) CHARACTER SET utf8mb4 DEFAULT '',
  `mobile` varchar(32) DEFAULT '',
  `create_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='渠道商';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN `app_banner` text;

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN `information_protection` longtext COMMENT '个人信息保护';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN `countdown_voice` varchar(255) DEFAULT '' COMMENT '倒计时语音';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN `primaryColor` varchar(255) DEFAULT '#A40035';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN `subColor` varchar(255) DEFAULT '#F1C06B';



ALTER TABLE `{$prefix}massage_service_coach_list` ADD COLUMN `is_update` tinyint(3) DEFAULT '0';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `coach_refund_text` varchar(625) CHARACTER SET utf8mb4 DEFAULT '';

ALTER TABLE `{$prefix}shequshop_school_config` modify COLUMN `trading_rules` longtext COMMENT '交易规则';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_coach_update` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `coach_name` varchar(255) DEFAULT '' COMMENT '名称',
  `user_id` int(11) DEFAULT NULL,
  `coach_id` int(11) DEFAULT NULL,
  `mobile` varchar(255) DEFAULT '',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  `sex` tinyint(3) DEFAULT '0' COMMENT '性别',
  `work_time` bigint(12) DEFAULT '0' COMMENT '从业年份',
  `city` varchar(255) DEFAULT '' COMMENT '城市',
  `lng` varchar(255) DEFAULT '',
  `lat` varchar(255) DEFAULT '',
  `address` varchar(625) DEFAULT '' COMMENT '详细地址',
  `text` varchar(625) DEFAULT '' COMMENT '简介',
  `id_card` varchar(625) DEFAULT '',
  `license` text COMMENT '执照',
  `work_img` varchar(255) DEFAULT '' COMMENT '工作照',
  `self_img` text COMMENT '个人照片',
  `is_work` tinyint(3) DEFAULT '1' COMMENT '是否工作',
  `start_time` varchar(32) DEFAULT '',
  `end_time` varchar(32) DEFAULT '',
  `id_code` varchar(255) DEFAULT '',
  `sh_text` varchar(1024) DEFAULT '',
  `sh_time` bigint(11) DEFAULT '0',
  `video` varchar(255) DEFAULT '' COMMENT '视频',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=127 DEFAULT CHARSET=utf8 COMMENT='技师修改表';

ALTER TABLE `{$prefix}massage_service_coach_update` ADD COLUMN `city_id` int(11) DEFAULT '0';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_coach_time` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `coach_id` int(11) DEFAULT '0' COMMENT '技师id',
  `date` char(16) DEFAULT '' COMMENT '日期  格式Y-m-d',
  `info` text COMMENT '日期节点详情',
  `hours` int(11) DEFAULT '0' COMMENT '日期节点在线时长',
  `uniacid` int(11) DEFAULT '0',
  `create_time` bigint(11) DEFAULT '0',
  `start_time` varchar(32) DEFAULT '' COMMENT '开始时间',
  `end_time` varchar(32) DEFAULT '' COMMENT '结束时间',
  `max_day` varchar(255) DEFAULT '',
  `time_unit` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `coach_id` (`coach_id`) USING BTREE,
  KEY `date` (`date`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='技师时间管理';

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_coach_time_list` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
  `time_id` int(11) DEFAULT '0' COMMENT '时间管理设置id',
  `time_str` varchar(16) DEFAULT '' COMMENT '开始时间戳',
  `time_str_end` varchar(16) DEFAULT '' COMMENT '结束时间戳',
  `time_text` varchar(16) DEFAULT '' COMMENT '时间',
  `time_texts` varchar(16) DEFAULT '' COMMENT '日期',
  `status` int(3) DEFAULT NULL COMMENT '状态',
  `create_time` bigint(11) DEFAULT '0',
  `coach_id` int(11) DEFAULT '0' COMMENT '技师id',
  `uniacid` int(11) DEFAULT '0',
  `is_click` tinyint(3) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `time_id` (`time_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='技师时间管理时间节点表';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `trip_start_address` varchar(255) DEFAULT ''  COMMENT '技师出发地址';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `trip_end_address` varchar(255) DEFAULT '' COMMENT '技师到达地址';

ALTER TABLE `{$prefix}massage_service_coach_time_list` ADD COLUMN `is_click` tinyint(3) DEFAULT '0';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `is_add` tinyint(3) DEFAULT '0' COMMENT '是否是加钟订单';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `add_pid` int(11) DEFAULT '0' COMMENT '加钟订单的父id';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `label_time` bigint(11) DEFAULT '0';

ALTER TABLE `{$prefix}massage_service_service_list` ADD COLUMN `is_add` tinyint(3) DEFAULT '0' COMMENT '是否是加钟服务';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN `time_interval` int(11) DEFAULT '0' COMMENT '时间间隔 单位分钟';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN `anonymous_evaluate` tinyint(3) DEFAULT '0' COMMENT '是否开启匿名评价';

ALTER TABLE `{$prefix}massage_service_refund_order` ADD COLUMN `is_add` tinyint(3) DEFAULT '0' COMMENT '是否是加钟订单';

ALTER TABLE `{$prefix}massage_service_car` ADD COLUMN `order_id` int(11) DEFAULT '0';

ALTER TABLE `{$prefix}massage_service_order_address` ADD COLUMN `address_id` int(11) DEFAULT '0';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_shop_carte` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT '' COMMENT '名称',
  `status` tinyint(3) DEFAULT '1' COMMENT '状态 1上架 0下架 -1 删除',
  `sort` int(10) DEFAULT NULL COMMENT '排序值  倒序',
  `create_time` int(11) DEFAULT '0' COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='物料分类';

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_shop_goods` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT '' COMMENT '名称',
  `carte` varchar(255) DEFAULT '' COMMENT '分类 以，分割',
  `cover` varchar(255) DEFAULT '' COMMENT '封面图',
  `images` text COMMENT '轮播图 json',
  `image_url` varchar(255) DEFAULT NULL COMMENT '轮播跳转链接',
  `video_url` varchar(255) DEFAULT NULL COMMENT '视频地址',
  `desc` longtext COMMENT '详情',
  `phone` varchar(255) DEFAULT NULL COMMENT '平台手机号',
  `uniacid` int(11) DEFAULT NULL,
  `status` tinyint(3) DEFAULT '1' COMMENT '状态 1上架 0下架 -1 删除',
  `sort` int(10) DEFAULT NULL COMMENT '排序值  倒序',
  `create_time` int(11) DEFAULT '0' COMMENT '创建时间',
  `price` decimal(10,2) DEFAULT '0.00' COMMENT '价格',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='物料商城商品';

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_coach_appeal` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `coach_id` int(11) DEFAULT '0' COMMENT '技师id',
  `uniacid` int(11) DEFAULT '0',
  `create_time` bigint(11) DEFAULT '0',
  `order_code` varchar(255) CHARACTER SET utf8 DEFAULT '' COMMENT '订单号',
  `order_id` int(11) DEFAULT '0' COMMENT '订单id',
  `content` text COMMENT '内容',
  `status` tinyint(3) DEFAULT '1' COMMENT '状态 1待处理 2已处理',
  `reply_content` text CHARACTER SET utf8 COMMENT '回复内容',
  `reply_date` datetime DEFAULT NULL COMMENT '回复时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='技师申诉';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_coach_feedback` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type_name` varchar(255) CHARACTER SET utf8 DEFAULT '' COMMENT '类型名称',
  `coach_id` int(11) DEFAULT '0' COMMENT '修改为用户id',
  `uniacid` int(11) DEFAULT '0',
  `create_time` bigint(11) DEFAULT '0',
  `order_code` varchar(255) CHARACTER SET utf8 DEFAULT '' COMMENT '订单号',
  `content` text COMMENT '内容',
  `images` text CHARACTER SET utf8 COMMENT '图片地址 json',
  `video_url` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '视频地址',
  `status` tinyint(3) DEFAULT '1' COMMENT '状态 1待处理 2已处理',
  `reply_content` text CHARACTER SET utf8 COMMENT '回复内容',
  `reply_date` datetime DEFAULT NULL COMMENT '回复时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='技师问题反馈';

ALTER TABLE `{$prefix}massage_service_car_price` ADD COLUMN `invented_distance` double(10,2) DEFAULT '0.00' COMMENT '虚拟里程';

ALTER TABLE `{$prefix}massage_service_coupon_atv` ADD COLUMN `is_atv_status` tinyint(3) DEFAULT '1';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN `service_btn_color` varchar(64) DEFAULT '#282B34';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN `service_font_color` varchar(64) DEFAULT '#EBDDB1';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `serout_lng` varchar(32) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `serout_lat` varchar(32) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `serout_address` varchar(32) DEFAULT '';

ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN `city_type` tinyint(3) DEFAULT '1' COMMENT '1城市代理 2区县代理';

ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN `admin_pid` int(11) DEFAULT '0' COMMENT '上级代理商';

ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN `level_balance` int(11) DEFAULT '0' COMMENT '上级';

ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN `city_id` int(11) DEFAULT '0' COMMENT '城市id';

ALTER TABLE `{$prefix}massage_service_city_list` ADD COLUMN `pid` int(11) DEFAULT '0';

ALTER TABLE `{$prefix}massage_service_order_commission` ADD COLUMN  `city_type` int(11) DEFAULT '1' COMMENT '1市级 2县级';

ALTER TABLE `{$prefix}massage_service_coach_level` ADD COLUMN `price` decimal(10,2) DEFAULT '0.00' COMMENT '最低业绩';

ALTER TABLE `{$prefix}massage_service_coach_level` ADD COLUMN `add_balance` int(11) DEFAULT '0' COMMENT '加钟率';

ALTER TABLE `{$prefix}massage_service_coach_level` ADD COLUMN `integral` double(10,2) DEFAULT '0.00' COMMENT '积分';

ALTER TABLE `{$prefix}massage_service_coach_level` ADD COLUMN `top` int(11) DEFAULT '0' COMMENT '等级';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN `level_cycle` int(11) DEFAULT '0' COMMENT '0不限 1每周 2每月 3每季度 4每年';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN `web_code_img` varchar(255) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_balance_order_list` ADD COLUMN `coach_id` int(11) DEFAULT '0';

ALTER TABLE `{$prefix}massage_service_balance_order_list` ADD COLUMN `integral` double(10,2) DEFAULT '0.00' COMMENT '积分';

ALTER TABLE `{$prefix}massage_service_coach_list` ADD COLUMN `integral` decimal(10,2) DEFAULT '0.00' COMMENT '积分';

ALTER TABLE `{$prefix}massage_service_city_list` ADD COLUMN `city_type` tinyint(3) DEFAULT '1';

ALTER TABLE `{$prefix}massage_service_city_list` ADD COLUMN `province` varchar(64) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_city_list` ADD COLUMN `city` varchar(64) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_city_list` ADD COLUMN `area` varchar(64) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_city_list` ADD COLUMN `id` int(11) unsigned NOT NULL AUTO_INCREMENT;

ALTER TABLE `{$prefix}massage_service_city_list` ADD COLUMN `province_code` varchar(64) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_city_list` ADD COLUMN `city_code` varchar(64) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_city_list` ADD COLUMN `area_code` varchar(64) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `pay_model` int(11) DEFAULT '1';

ALTER TABLE `{$prefix}massage_service_balance_order_list` ADD COLUMN `pay_model` int(11) DEFAULT '1';

ALTER TABLE `{$prefix}massage_service_balance_order_list` ADD COLUMN `rebates_balance` int(11) DEFAULT '0' COMMENT '返佣比例';

ALTER TABLE `{$prefix}shequshop_school_pay_config` ADD COLUMN `ali_appid` varchar(64) DEFAULT '' COMMENT '支付宝appid';

ALTER TABLE `{$prefix}shequshop_school_pay_config` ADD COLUMN `ali_privatekey` text COMMENT '支付宝私钥';

ALTER TABLE `{$prefix}shequshop_school_pay_config` ADD COLUMN `ali_publickey` text COMMENT '支付宝公钥';

ALTER TABLE `{$prefix}massage_service_coach_list` ADD COLUMN `order_num` int(11) DEFAULT '0' COMMENT '技师虚拟订单数量';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN `promotion_poster_img` varchar(255) DEFAULT 'https://lbqny.migugu.com/admin/anmo/mine/fx-share.png';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN `bind_technician_img` varchar(255) DEFAULT 'https://lbqny.migugu.com/admin/anmo/mine/inv_coach.png';

ALTER TABLE `{$prefix}shequshop_school_config` ADD COLUMN `is_current` tinyint(3) DEFAULT '2' COMMENT '2上个周期 1本期';





ALTER TABLE `{$prefix}massage_service_banner` ADD COLUMN   `connect_type` int(11) DEFAULT '1' COMMENT '1查看大图；2文章（默认1）\ntype_id  关联内容id\n';
ALTER TABLE `{$prefix}massage_service_banner` ADD COLUMN   `type_id` int(11) DEFAULT '1';

ALTER TABLE `{$prefix}massage_service_order_goods_list` ADD COLUMN  `status` tinyint(3) DEFAULT '1';

ALTER TABLE `{$prefix}massage_service_coach_police` ADD COLUMN `lng` varchar(32) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_coach_police` ADD COLUMN `lat` varchar(32) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_coach_police` ADD COLUMN `address` varchar(64) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_user_list` ADD COLUMN `ios_openid` varchar(64) DEFAULT '0' COMMENT '苹果登录的账号';

ALTER TABLE `{$prefix}massage_service_user_list` ADD COLUMN `push_id` varchar(64) DEFAULT '';

ALTER TABLE `{$prefix}massage_service_user_list` ADD COLUMN `alipay_number` varchar(128) DEFAULT '' COMMENT '支付宝账号';

ALTER TABLE `{$prefix}shequshop_school_pay_config` ADD COLUMN `alipay_status` tinyint(3) DEFAULT '0';

alter table `{$prefix}massage_aliyun_reminder_record`  ADD COLUMN `status` tinyint(3) DEFAULT '1';

alter table `{$prefix}massage_service_car_price`  ADD COLUMN `city_id` int(11) DEFAULT '0' COMMENT '城市id';
alter table `{$prefix}massage_service_car_price`  ADD COLUMN `status` tinyint(3) DEFAULT '1';
alter table `{$prefix}massage_service_car_price`  ADD COLUMN `create_time` bigint(11) DEFAULT '0';

alter table `{$prefix}massage_service_coach_list`  ADD COLUMN `recommend` tinyint(3) DEFAULT '0' COMMENT '是否是推荐技师';

alter table `{$prefix}shequshop_school_pay_config`  ADD COLUMN `appCretPublicKey` varchar(255) DEFAULT '' COMMENT '支付宝应用公钥';
alter table `{$prefix}shequshop_school_pay_config`  ADD COLUMN `alipayCretPublicKey` varchar(255) DEFAULT '' COMMENT '支付宝公钥';
alter table `{$prefix}shequshop_school_pay_config`  ADD COLUMN `alipayRootCret` varchar(255) DEFAULT '' COMMENT '支付宝根证书';
alter table `{$prefix}shequshop_school_pay_config`  ADD COLUMN `alipay_type` tinyint(3) DEFAULT '1' COMMENT '1 密钥模式 2证书模式';
alter table `{$prefix}massage_service_coach_level`  ADD COLUMN `online_time` int(11) DEFAULT '0' COMMENT '在线时长小时';

alter table `{$prefix}massage_service_coach_level`  ADD COLUMN `agent_article_id` int(11) DEFAULT '0' COMMENT '代理商入住的文章id';

alter table `{$prefix}shequshop_school_config`  ADD COLUMN `agent_article_id` int(11) DEFAULT '0' COMMENT '代理商入住的文章id';

alter table `{$prefix}shequshop_school_admin`  ADD COLUMN `province` varchar(255) DEFAULT '';



alter table `{$prefix}massage_service_order_address` ADD INDEX  `order_id` (`order_id`) USING BTREE;

alter table `{$prefix}massage_service_order_goods_list` ADD INDEX  `order_id` (`order_id`) USING BTREE;

alter table `{$prefix}massage_service_order_list` ADD INDEX `uniacid` (`uniacid`) USING BTREE;

alter table `{$prefix}massage_coach_work_log` ADD INDEX `coach_id` (`coach_id`) USING BTREE;




CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_user_label_data` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `label_id` int(11) DEFAULT '0',
  `title` varchar(255) DEFAULT '',
  `status` tinyint(3) DEFAULT '1',
  `user_id` int(11) DEFAULT '0',
  `create_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_user_label_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT '',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_integral_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `coach_id` int(11) DEFAULT NULL,
  `integral` double(10,2) DEFAULT '0.00',
  `type` int(11) DEFAULT '0',
  `create_time` bigint(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  `order_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;





CREATE TABLE IF NOT EXISTS `{$prefix}massage_aliyun_phone_config` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `pool_key` varchar(128) DEFAULT '' COMMENT '号码池',
  `virtual_status` tinyint(3) DEFAULT '0',
  `reminder_public` tinyint(3) DEFAULT '0' COMMENT '语音通知 专属模式 1公共模式',
  `reminder_tmpl_id` varchar(64) DEFAULT '' COMMENT '语音通知模版id',
  `reminder_phone` varchar(32) DEFAULT '' COMMENT '语音通知电话',
  `reminder_status` tinyint(3) DEFAULT '0' COMMENT '语音通知开关',
  `reminder_timing` int(255) DEFAULT '0' COMMENT '语音通知定时任务',
  `reminder_admin_status` tinyint(3) DEFAULT '0' COMMENT '来电提醒是否通知管理员',
  `reminder_admin_phone` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_aliyun_phone_record` (
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `subs_id` varchar(64) DEFAULT '',
  `phone_a` varchar(32) DEFAULT '',
  `phone_b` varchar(32) DEFAULT '',
  `phone_x` varchar(32) DEFAULT '',
  `expire_date` bigint(11) DEFAULT '0',
  `status` bigint(11) DEFAULT '1',
  `need_record` tinyint(3) DEFAULT '1',
  `pool_key` varchar(255) DEFAULT '',
  `order_id` int(11) DEFAULT '0',
  `order_code` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_aliyun_play_record` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `pool_key` varchar(128) DEFAULT '',
  `phone_x` varchar(32) DEFAULT '' COMMENT '虚拟号码',
  `phone_a` varchar(32) DEFAULT '',
  `phone_b` varchar(32) DEFAULT '',
  `call_time` bigint(11) DEFAULT NULL COMMENT '拨打时间',
  `start_time` bigint(11) DEFAULT '0' COMMENT '接起时间',
  `end_time` bigint(11) DEFAULT '0' COMMENT '挂断时间',
  `record_url` varchar(255) DEFAULT NULL COMMENT '放音录音URL',
  `ring_record_url` varchar(255) DEFAULT NULL COMMENT '放音录音URL',
  `call_id` varchar(64) DEFAULT '' COMMENT '话记录ID',
  `sub_id` varchar(64) DEFAULT '' COMMENT '关系',
  `out_id` varchar(128) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_aliyun_reminder_record` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_id` int(11) DEFAULT NULL,
  `create_time` bigint(11) DEFAULT '0',
  `res` text COMMENT '通知结果',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;




CREATE TABLE IF NOT EXISTS `{$prefix}massage_help_notice_config` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `help_phone` varchar(32) DEFAULT '' COMMENT '求救电话',
  `help_user_id` text COMMENT '求救人',
  `help_voice` varchar(255) DEFAULT '' COMMENT '求救录音',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_order_price_log` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_id` int(11) DEFAULT NULL,
  `order_price` decimal(10,2) DEFAULT '0.00',
  `can_refund_price` decimal(10,2) DEFAULT '0.00',
  `is_top` int(11) DEFAULT NULL,
  `top_order_id` int(11) DEFAULT '0',
  `transaction_id` varchar(128) DEFAULT '',
  `order_code` varchar(128) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_order_list_data` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_id` int(11) DEFAULT '0',
  `sign_time` bigint(11) DEFAULT '0' COMMENT '签字时间',
  `sign_img` varchar(255) DEFAULT '' COMMENT '签字图片',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_up_order_goods_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_id` int(11) DEFAULT NULL,
  `goods_id` int(11) DEFAULT NULL,
  `goods_name` varchar(255) DEFAULT '',
  `goods_cover` varchar(255) DEFAULT '',
  `price` decimal(10,2) DEFAULT '0.00',
  `true_price` decimal(10,2) DEFAULT '0.00',
  `time_long` int(11) DEFAULT '0',
  `num` int(11) DEFAULT NULL,
  `order_goods_id` int(11) DEFAULT '0',
  `pay_price` decimal(10,2) DEFAULT '0.00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_up_order_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_id` int(11) DEFAULT NULL,
  `order_code` varchar(64) DEFAULT '',
  `pay_price` decimal(10,2) DEFAULT '0.00',
  `user_id` int(11) DEFAULT '0',
  `create_time` bigint(11) DEFAULT '0',
  `pay_type` tinyint(3) DEFAULT '1',
  `transaction_id` varchar(64) DEFAULT '',
  `surplus_price` decimal(10,2) DEFAULT '0.00' COMMENT '除去退款剩余金额',
  `pay_model` int(11) DEFAULT '1',
  `order_price` decimal(10,2) DEFAULT '0.00',
  `pay_time` bigint(11) DEFAULT '0',
  `total_num` int(11) DEFAULT '0',
  `order_goods_id` int(11) DEFAULT '0',
  `balance` decimal(10,2) DEFAULT '0.00',
  `coach_id` int(11) DEFAULT '0',
  `time_long` int(11) DEFAULT '0',
  `service_price` decimal(10,2) DEFAULT '0.00',
  `discount` decimal(10,2) DEFAULT '0.00',
  `over_time` int(11) DEFAULT '0',
  `true_service_price` decimal(10,2) DEFAULT '0.00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_article_connect` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `article_id` int(11) DEFAULT '0',
  `field_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_article_form_field` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `field_type` int(11) DEFAULT '1',
  `title` varchar(128) CHARACTER SET utf8mb4 DEFAULT '',
  `status` tinyint(3) DEFAULT '1',
  `top` int(11) DEFAULT '0',
  `is_required` tinyint(3) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_article_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT '',
  `text` longtext CHARACTER SET utf8mb4,
  `is_form` tinyint(3) DEFAULT '0',
  `top` int(11) DEFAULT NULL,
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_article_sub_data` (
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `sub_id` int(11) DEFAULT '0',
  `field_id` int(11) DEFAULT NULL,
  `key` varchar(255) CHARACTER SET utf8mb4 DEFAULT '',
  `value` varchar(1024) CHARACTER SET utf8mb4 DEFAULT '',
  `status` tinyint(3) DEFAULT '1',
  `field_type` tinyint(3) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;





CREATE TABLE IF NOT EXISTS `{$prefix}massage_article_sub_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `create_time` bigint(11) DEFAULT '0',
  `article_id` int(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_config` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `dynamic_check` tinyint(3) DEFAULT '1' COMMENT '1手动审核 2自动',
  `dynamic_comment_check` tinyint(3) DEFAULT '1',
  `app_download_img` varchar(255) DEFAULT '' COMMENT 'app下载图片',
  `android_link` varchar(255) DEFAULT '' COMMENT '安卓下载链接',
  `ios_link` varchar(255) DEFAULT '' COMMENT 'ios下载链接',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_shield_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `coach_id` int(11) DEFAULT NULL,
  `type` tinyint(3) DEFAULT '1' COMMENT '1动态  2技师',
  `create_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_coach_work_log` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `coach_id` int(11) DEFAULT NULL,
  `date` varchar(11) DEFAULT '',
  `create_time` bigint(11) DEFAULT '0',
  `time` int(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  `true_time` bigint(11) DEFAULT '0',
  `start_time` varchar(32) DEFAULT '',
  `end_time` varchar(32) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_send_msg_config` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `help_tmpl_id` varchar(64) DEFAULT '',
  `gzh_appid` varchar(64) DEFAULT '',
  `order_tmp_id` varchar(64) DEFAULT '',
  `cancel_tmp_id` varchar(64) DEFAULT '',
  `coachupdate_tmp_id` varchar(64) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_short_code_config` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `short_sign` varchar(255) DEFAULT '' COMMENT '短信签名',
  `order_short_code` varchar(255) DEFAULT '' COMMENT '订单短信模版code',
  `refund_short_code` varchar(255) DEFAULT NULL COMMENT '退单短信模版code',
  `help_short_code` varchar(255) DEFAULT '',
  `short_code` varchar(255) DEFAULT NULL,
  `short_code_status` tinyint(3) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_dynamic_comment` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `dynamic_id` int(11) DEFAULT '0',
  `text` text CHARACTER SET utf8mb4,
  `comment_id` int(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  `have_look` tinyint(3) DEFAULT '0',
  `coach_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_dynamic_follow` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `coach_id` int(11) DEFAULT '0',
  `status` int(11) DEFAULT '1',
  `have_look` tinyint(3) DEFAULT '0',
  `dynamic_id` int(11) DEFAULT '0',
  `create_time` bigint(11) DEFAULT '0',
  `dynamic_num` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_dynamic_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(255) CHARACTER SET utf8mb4 DEFAULT '',
  `cover` varchar(255) DEFAULT NULL,
  `imgs` text,
  `text` text CHARACTER SET utf8mb4,
  `lng` varchar(32) DEFAULT '',
  `lat` varchar(32) DEFAULT '',
  `address` varchar(128) DEFAULT '',
  `user_id` int(11) DEFAULT '0',
  `coach_id` int(11) DEFAULT '0' COMMENT 'j技师id',
  `status` int(11) DEFAULT '0',
  `create_time` bigint(11) DEFAULT '0',
  `top` int(11) DEFAULT '0',
  `pv` int(11) DEFAULT '0' COMMENT '浏览数',
  `check_time` bigint(11) DEFAULT '0',
  `check_text` varchar(625) DEFAULT '' COMMENT '拒绝理由',
  `type` tinyint(3) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_dynamic_thumbs` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `dynamic_id` int(11) DEFAULT '0',
  `create_time` bigint(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  `have_look` tinyint(3) DEFAULT '0',
  `coach_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_dynamic_watch_record` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `dynamic_id` int(11) DEFAULT '0',
  `user_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


alter table `{$prefix}massage_config`  ADD COLUMN `dynamic_status` tinyint(3) DEFAULT '1' COMMENT '动态开关';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_coach_time_log` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `coach_id` int(11) DEFAULT NULL,
  `start_time` varchar(32) DEFAULT '',
  `end_time` varchar(32) DEFAULT '',
  `time` int(11) DEFAULT '0',
  `date` varchar(32) DEFAULT '',
  `create_time` bigint(11) DEFAULT '0',
  `is_work` int(11) DEFAULT '0',
  `is_admin` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_add_clock_setting` (
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `times` int(11) DEFAULT '1',
  `balance` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

alter table `{$prefix}massage_config`  ADD COLUMN `clock_cash_status` tinyint(3) DEFAULT '0' COMMENT '加钟返佣金';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_order_coach_change_logs` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_id` int(11) DEFAULT NULL,
  `old_coach_id` int(11) DEFAULT '0',
  `now_coach_id` int(11) DEFAULT '0',
  `create_time` bigint(11) DEFAULT '0',
  `now_coach_name` varchar(255) CHARACTER SET utf8mb4 DEFAULT '',
  `car_price` decimal(10,2) DEFAULT NULL,
  `init_coach_id` int(11) DEFAULT '0' COMMENT '第一个技师的id',
  `have_car_price` tinyint(3) DEFAULT '0' COMMENT '是否已经给了车费',
  `text` varchar(625) CHARACTER SET utf8mb4 DEFAULT '',
  `old_coach_name` varchar(255) CHARACTER SET utf8mb4 DEFAULT '',
  `start_time` bigint(11) DEFAULT '0' COMMENT '原来订单的开始时间',
  `end_time` bigint(11) DEFAULT '0' COMMENT '原来订单的结束时间',
  `status` tinyint(3) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单技师移交记录表';



CREATE TABLE IF NOT EXISTS `{$prefix}massage_order_control_log` (
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_id` int(11) DEFAULT NULL,
  `admin_control` tinyint(3) DEFAULT '0',
  `create_time` bigint(11) DEFAULT '0',
  `pay_type` tinyint(3) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单操作日志';


alter table `{$prefix}massage_order_control_log`  ADD COLUMN  `old_pay_type` int(11) DEFAULT '0';

alter table `{$prefix}massage_order_control_log`  ADD COLUMN  `user_id` int(11) DEFAULT '0' COMMENT '用户id';

alter table `{$prefix}massage_aliyun_phone_record`  ADD COLUMN  `create_time` bigint(11) DEFAULT '0';

alter table `{$prefix}massage_aliyun_phone_record`  ADD COLUMN   `text` text;

alter table `{$prefix}massage_config`  ADD COLUMN  `balance_cash` tinyint(3) DEFAULT '0' COMMENT '余额返回佣金';

alter table `{$prefix}massage_config`  ADD COLUMN  `balance_integral` tinyint(3) DEFAULT '1' COMMENT '余额返回积分';

alter table `{$prefix}massage_config`  ADD COLUMN  `balance_balance` int(11) DEFAULT '100' COMMENT '返回的比例';


alter table `{$prefix}massage_integral_list`  ADD COLUMN  `balance` int(11) DEFAULT '0';
alter table `{$prefix}massage_integral_list`  ADD COLUMN  `user_id` int(11) DEFAULT NULL;
alter table `{$prefix}massage_integral_list`  ADD COLUMN  `user_cash` decimal(10,2) DEFAULT '0.00' COMMENT '用户充值金额';
alter table `{$prefix}massage_service_coach_list`  ADD COLUMN  `balance_cash` decimal(10,2) DEFAULT '0.00' COMMENT '邀请充值余额返回佣金';

alter table `{$prefix}massage_service_coach_list`  ADD COLUMN  `index_top` tinyint(3) DEFAULT '0' COMMENT '虚拟排序';

alter table `{$prefix}massage_aliyun_phone_config` ADD COLUMN  `notice_agent` tinyint(3) DEFAULT '0' COMMENT '是否通知代理商';



alter table `{$prefix}massage_service_wallet_list` ADD COLUMN  `apply_transfer` tinyint(3) DEFAULT '0' COMMENT '申请转账方式';

alter table `{$prefix}massage_service_wallet_list` ADD COLUMN  `lock` int(11) DEFAULT '0';

alter table `{$prefix}massage_service_coach_list` ADD COLUMN  `coach_position` tinyint(3) DEFAULT '0' COMMENT '实时定位';

alter table `{$prefix}massage_service_coach_list` ADD COLUMN  `near_time` bigint(11) DEFAULT '0';

alter table `{$prefix}massage_order_coach_change_logs` ADD COLUMN `pay_type` int(11) DEFAULT '2';

alter table `{$prefix}massage_order_coach_change_logs` ADD COLUMN `old_coach_mobile` varchar(32) DEFAULT '';

alter table `{$prefix}massage_order_coach_change_logs` ADD COLUMN `now_coach_mobile` varchar(32) DEFAULT '';

alter table `{$prefix}massage_order_coach_change_logs` ADD COLUMN `is_new` tinyint(3) DEFAULT '0';

alter table `{$prefix}shequshop_school_attachment` ADD COLUMN `admin_id` int(11) DEFAULT '0';

alter table `{$prefix}massage_aliyun_play_record` ADD COLUMN  `call_type` int(11) DEFAULT '0' COMMENT '呼叫类型。取值：\n0：主叫，即phone_no打给peer_no。\n1：被叫，即peer_no打给phone_no。\n4：呼叫拦截。';

CREATE TABLE IF NOT EXISTS `{$prefix}massage_config_setting` (
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `key` varchar(64) DEFAULT '',
  `value` varchar(1024) CHARACTER SET utf8mb4 DEFAULT '',
  `text` varchar(255) DEFAULT '' COMMENT '备注',
  `default_value` varchar(255) CHARACTER SET utf8mb4 DEFAULT '',
  `field_type` int(32) DEFAULT '1' COMMENT '1数字 2 字符串',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_role_admin` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `admin_id` int(11) DEFAULT '0',
  `role_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_role_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(64) DEFAULT '',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_role_node` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `role_id` int(11) DEFAULT '0' COMMENT '角色id',
  `node` varchar(625) DEFAULT '',
  `auth` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_action_log` (
  `id` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `ip` varchar(32) DEFAULT '',
  `create_time` bigint(11) DEFAULT '0',
  `model` varchar(32) DEFAULT '' COMMENT '模块名',
  `action` varchar(32) DEFAULT '',
  `obj_id` int(11) DEFAULT '0',
  `code_action` varchar(255) DEFAULT '',
  `table` varchar(255) DEFAULT '',
  `method` varchar(32) DEFAULT '',
  `action_type` varchar(64) DEFAULT '',
  `title` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `uniacid` (`uniacid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_distribution_config` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT '',
  `balance` int(11) DEFAULT '0',
  `top` int(11) DEFAULT '0',
  `balance_name` varchar(255) DEFAULT '',
  `obj_name` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_store_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(64) DEFAULT '',
  `attestation` varchar(255) DEFAULT '' COMMENT '门店认证',
  `star` decimal(10,1) DEFAULT '0.0' COMMENT '评分',
  `order_num` int(11) DEFAULT '0' COMMENT '虚拟单量',
  `order_rate` int(11) DEFAULT '0' COMMENT '接单率',
  `true_order_num` int(11) DEFAULT '0' COMMENT '真实单量',
  `total_num` int(11) DEFAULT '0' COMMENT '总单量',
  `positive_rate` int(11) DEFAULT '0' COMMENT '好评率',
  `business_license` varchar(255) DEFAULT '' COMMENT '营业执照',
  `text` text CHARACTER SET utf8mb4,
  `admin_id` int(11) DEFAULT '0' COMMENT '代理商',
  `start_time` varchar(32) DEFAULT '',
  `end_time` varchar(32) DEFAULT '',
  `lng` varchar(32) DEFAULT '',
  `lat` varchar(32) DEFAULT '',
  `address` varchar(255) DEFAULT '',
  `create_time` bigint(11) DEFAULT '0',
  `status` int(11) DEFAULT '1',
  `sh_time` bigint(11) DEFAULT '0',
  `sh_text` varchar(1024) CHARACTER SET utf8mb4 DEFAULT '',
  `cover` varchar(225) DEFAULT '',
  `phone` varchar(32) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

alter table `{$prefix}massage_service_order_commission` ADD COLUMN `coach_cash` decimal(10,2) DEFAULT '0.00';

alter table `{$prefix}massage_service_order_commission` ADD COLUMN `car_cash` decimal(10,2) DEFAULT '0.00';

alter table `{$prefix}massage_service_order_commission` ADD COLUMN `cash_status` tinyint(3) DEFAULT '1' COMMENT '代理商是否给线下技师打款';

alter table `{$prefix}massage_aliyun_phone_config` ADD COLUMN `moor_phone_arr` varchar(1024) DEFAULT '' COMMENT '七莫号码';

alter table `{$prefix}massage_aliyun_phone_config` ADD COLUMN `moor_id` varchar(64) DEFAULT '';
alter table `{$prefix}massage_aliyun_phone_config` ADD COLUMN `moor_url` varchar(255) DEFAULT 'https://openapis.7moor.com';
alter table `{$prefix}massage_aliyun_phone_config` ADD COLUMN `moor_secret` varchar(64) DEFAULT '';
alter table `{$prefix}massage_aliyun_phone_config` ADD COLUMN `virtual_type` tinyint(3) DEFAULT '1';
alter table `{$prefix}massage_aliyun_phone_record` ADD COLUMN `type` tinyint(3) DEFAULT '1';

alter table `{$prefix}massage_service_wallet_list` ADD COLUMN `user_num` varchar(225) DEFAULT '';

alter table `{$prefix}massage_action_log` ADD COLUMN `action_type` varchar(64) DEFAULT '';

alter table `{$prefix}massage_action_log` ADD COLUMN `title` varchar(255) DEFAULT '';

alter table `{$prefix}massage_service_user_list` ADD COLUMN `alipay_name` varchar(128) CHARACTER SET utf8mb4 DEFAULT '';

alter table `{$prefix}massage_service_coach_list` ADD COLUMN `agent_type` tinyint(3) DEFAULT '1' COMMENT '1代理商 2合伙人';

alter table `{$prefix}massage_service_coach_list` ADD COLUMN `partner_id` int(11) DEFAULT '0' COMMENT '技师经纪人关联的用户id';

alter table `{$prefix}massage_service_coach_list` ADD COLUMN `partner_time` bigint(11) DEFAULT '0' COMMENT '合伙人绑定时间';

alter table `{$prefix}massage_service_coach_list` ADD COLUMN `store_id` int(11) DEFAULT '0' COMMENT '挂靠门店';

alter table `{$prefix}shequshop_school_admin` ADD COLUMN  `agent_name` varchar(255) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '代理商名字';

alter table `{$prefix}massage_service_service_list` ADD COLUMN  `admin_id` int(11) DEFAULT '0';

alter table `{$prefix}massage_service_service_list` ADD COLUMN  `check_time` bigint(11) DEFAULT '0';

alter table `{$prefix}massage_service_service_list` ADD COLUMN  `check_text` varchar(625) CHARACTER SET utf8mb4 DEFAULT '';

alter table `{$prefix}massage_service_service_list` ADD COLUMN  `type` tinyint(3) DEFAULT '1';

alter table `{$prefix}massage_service_service_list` ADD COLUMN  `check_status` tinyint(3) DEFAULT '2';

alter table `{$prefix}massage_service_refund_order` ADD COLUMN  `partner_id` int(11) DEFAULT '0' COMMENT '技师经纪人关联的用户id';

alter table `{$prefix}massage_service_order_list` ADD COLUMN  `partner_id` int(11) DEFAULT '0' COMMENT '技师经纪人关联的用户id';

alter table `{$prefix}massage_service_order_list` ADD COLUMN  `store_id` int(11) DEFAULT '0' COMMENT '门店id';

alter table `{$prefix}massage_channel_list` ADD COLUMN  `total_cash` decimal(10,2) DEFAULT '0.00';

alter table `{$prefix}massage_channel_list` ADD COLUMN  `cash` decimal(10,2) DEFAULT '0.00';

alter table `{$prefix}massage_service_wallet_list` ADD COLUMN `tax_point` int(11) DEFAULT '0' COMMENT '税点';

alter table `{$prefix}massage_service_coach_update` ADD COLUMN `store_id` int(11) DEFAULT '0' COMMENT '门店id';

alter table `{$prefix}shequshop_school_attachment_group` ADD COLUMN  `admin_id` int(11) DEFAULT '0';

alter table `{$prefix}massage_service_order_goods_list` ADD COLUMN  `coupon_discount` decimal(10,2) DEFAULT '0.00';

alter table `{$prefix}massage_service_up_order_list` ADD COLUMN  `coupon_discount` decimal(10,2) DEFAULT '0.00';

alter table `{$prefix}shequshop_school_admin` ADD COLUMN  `agreement` varchar(255) DEFAULT '' COMMENT '公司合同模版';

alter table `{$prefix}shequshop_school_admin` ADD COLUMN  `agreement_title` varchar(255) DEFAULT '' COMMENT '合同标题';

alter table `{$prefix}massage_service_user_list` ADD COLUMN  `ip` varchar(32) DEFAULT '';

alter table `{$prefix}massage_aliyun_phone_config` ADD COLUMN  `reminder_type` tinyint(3) DEFAULT '1' COMMENT '语音通知 type1 阿里云 2七莫';

alter table `{$prefix}massage_aliyun_phone_config` ADD COLUMN  `reminder_text` varchar(1024) DEFAULT '技师您好，您有新的订单注意查看' COMMENT '语音通知内容';

alter table `{$prefix}massage_aliyun_phone_config` ADD COLUMN  `moor_reminder_phone` varchar(32) DEFAULT '' COMMENT '七莫语音通知';

alter table `{$prefix}massage_short_code_config` ADD COLUMN  `moor_order_short_code` varchar(255) DEFAULT '';
alter table `{$prefix}massage_short_code_config` ADD COLUMN  `moor_refund_short_code` varchar(255) DEFAULT '';
alter table `{$prefix}massage_short_code_config` ADD COLUMN  `moor_help_short_code` varchar(255) DEFAULT '';
alter table `{$prefix}massage_short_code_config` ADD COLUMN  `moor_short_code` varchar(255) DEFAULT '';
alter table `{$prefix}massage_short_code_config` ADD COLUMN  `type` tinyint(3) DEFAULT '1' COMMENT '1阿里云 2七莫';

alter table `{$prefix}massage_channel_list` ADD COLUMN `salesman_id` int(11) DEFAULT '0' COMMENT '业务员id';

alter table `{$prefix}massage_channel_list` ADD COLUMN `admin_id` int(11) DEFAULT '0' COMMENT '代理商id';

alter table `{$prefix}shequshop_school_admin` ADD COLUMN `phone_admin_num` int(11) DEFAULT '0' COMMENT '手机端管理员用户个数';

alter table `{$prefix}shequshop_school_admin` ADD COLUMN `phone_encryption` tinyint(3) DEFAULT '0' COMMENT '手机号码加密';

alter table `{$prefix}shequshop_school_admin` ADD COLUMN `salesman_auth` tinyint(3) DEFAULT '0' COMMENT '是否可以邀请业务员';

alter table `{$prefix}massage_order_control_log` ADD COLUMN `type` tinyint(3) DEFAULT '1' COMMENT '1订单 2退款';

alter table `{$prefix}shequshop_school_admin` ADD COLUMN `channel_auth` tinyint(3) DEFAULT '0' COMMENT '是否可以邀请渠道商';

alter table `{$prefix}shequshop_school_admin` ADD COLUMN `partner_auth` tinyint(3) DEFAULT '0' COMMENT '经济人权限';

alter table `{$prefix}massage_service_order_list` ADD COLUMN `salesman_id` int(11) DEFAULT '0' COMMENT '业务员id';

alter table `{$prefix}massage_service_order_list` ADD COLUMN `material_price` decimal(10,2) DEFAULT '0.00' COMMENT '物料费';

alter table `{$prefix}massage_service_service_list` ADD COLUMN `material_price` decimal(10,2) DEFAULT '0.00' COMMENT '物料费';

alter table `{$prefix}massage_service_order_goods_list` ADD COLUMN `material_price` decimal(10,2) DEFAULT '0.00' COMMENT '物料费';

alter table `{$prefix}massage_service_refund_order_goods` ADD COLUMN `material_price` decimal(10,2) DEFAULT '0.00' COMMENT '物料费';

alter table `{$prefix}massage_service_refund_order` ADD COLUMN `material_price` decimal(10,2) DEFAULT '0.00' COMMENT '物料费';

alter table `{$prefix}massage_service_balance_order_list` ADD COLUMN `admin_user` int(11) DEFAULT '0' COMMENT '后台操作人';

alter table `{$prefix}massage_service_balance_order_list` ADD COLUMN `type` tinyint(3) DEFAULT '1';

alter table `{$prefix}massage_service_order_list` ADD COLUMN `type` tinyint(3) DEFAULT '0';

alter table `{$prefix}massage_service_order_address` ADD COLUMN `coach_lng` varchar(64) DEFAULT '';

alter table `{$prefix}massage_service_order_address` ADD COLUMN `coach_lat` varchar(64) DEFAULT '';

alter table `{$prefix}massage_service_order_address` ADD COLUMN `coach_address` varchar(255) DEFAULT '';

alter table `{$prefix}massage_service_coach_list` ADD COLUMN `auth_status` tinyint(3) DEFAULT '2' COMMENT '认证状态';

alter table `{$prefix}shequshop_school_admin` ADD COLUMN `license` varchar(255) DEFAULT '' COMMENT '营业执照';

alter table `{$prefix}shequshop_school_admin` ADD COLUMN `agreement_time` int(11) DEFAULT '0';

alter table `{$prefix}massage_service_coach_list` ADD COLUMN `total_order_num` int(11) DEFAULT '-1' COMMENT '总的订单量  真实+虚拟';

alter table `{$prefix}massage_service_up_order_goods_list` ADD COLUMN `coupon_discount` decimal(10,2) DEFAULT '0.00';

alter table `{$prefix}massage_service_coach_list` ADD COLUMN `birthday` bigint(11) DEFAULT '0';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_store_list` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(64) DEFAULT '',
  `attestation` varchar(255) DEFAULT '' COMMENT '门店认证',
  `star` decimal(10,1) DEFAULT '0.0' COMMENT '评分',
  `order_num` int(11) DEFAULT '0' COMMENT '虚拟单量',
  `order_rate` int(11) DEFAULT '0' COMMENT '接单率',
  `true_order_num` int(11) DEFAULT '0' COMMENT '真实单量',
  `total_num` int(11) DEFAULT '0' COMMENT '总单量',
  `positive_rate` int(11) DEFAULT '0' COMMENT '好评率',
  `business_license` varchar(255) DEFAULT '' COMMENT '营业执照',
  `text` text CHARACTER SET utf8mb4,
  `admin_id` int(11) DEFAULT '0' COMMENT '代理商',
  `start_time` varchar(32) DEFAULT '',
  `end_time` varchar(32) DEFAULT '',
  `lng` varchar(32) DEFAULT '',
  `lat` varchar(32) DEFAULT '',
  `address` varchar(255) DEFAULT '',
  `create_time` bigint(11) DEFAULT '0',
  `status` int(11) DEFAULT '1',
  `sh_time` bigint(11) DEFAULT '0',
  `sh_text` varchar(1024) CHARACTER SET utf8mb4 DEFAULT '',
  `cover` varchar(225) DEFAULT '',
  `phone` varchar(32) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_store_service` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `service_id` int(11) DEFAULT '0',
  `store_id` int(11) DEFAULT '0',
  `admin_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_mobile_role_admin` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `admin_id` int(11) DEFAULT '0',
  `role_id` int(11) DEFAULT '0',
  `node` varchar(512) DEFAULT '',
  `user_id` int(11) DEFAULT '0',
  `mobile` varchar(32) DEFAULT '',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='手机权限角色表';



CREATE TABLE IF NOT EXISTS `{$prefix}massage_salesman_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `user_name` varchar(64) CHARACTER SET utf8mb4 DEFAULT '',
  `phone` varchar(32) DEFAULT '',
  `admin_id` int(11) DEFAULT '0' COMMENT '代理商',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  `sh_time` bigint(11) DEFAULT '0' COMMENT '审核时间',
  `sh_text` varchar(625) CHARACTER SET utf8mb4 DEFAULT '',
  `cash` decimal(10,2) DEFAULT '0.00',
  `total_cash` decimal(10,2) DEFAULT '0.00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='分销员列表';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_recording_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_id` int(11) DEFAULT '0',
  `link` varchar(625) DEFAULT '',
  `create_time` bigint(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='服务录音';



CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_order_process` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_id` int(11) DEFAULT NULL,
  `lat` varchar(64) DEFAULT '',
  `lng` varchar(64) DEFAULT '',
  `address` varchar(255) DEFAULT '',
  `img` varchar(255) DEFAULT '',
  `time` bigint(11) DEFAULT '0',
  `type` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单服务过程表';



CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_cate_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(64) DEFAULT '',
  `cover` varchar(255) DEFAULT '',
  `top` int(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='服务分类';



CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_cate_connect` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `service_id` int(11) DEFAULT '0',
  `cate_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_agent_apply` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_name` varchar(64) CHARACTER SET utf8mb4 DEFAULT '',
  `city_type` tinyint(3) DEFAULT '1',
  `phone` varchar(32) DEFAULT '',
  `city` varchar(255) DEFAULT '',
  `status` tinyint(3) DEFAULT '0',
  `create_time` bigint(11) DEFAULT '0',
  `sh_time` bigint(11) DEFAULT '0',
  `user_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_fdd_agreement_record` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `coach_id` int(11) DEFAULT '0',
  `admin_id` int(11) DEFAULT '0',
  `link` varchar(255) DEFAULT '',
  `create_time` bigint(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  `contract_id` varchar(64) DEFAULT '' COMMENT '合同编号',
  `customer_id` varchar(64) DEFAULT '' COMMENT '账号id',
  `agreement_title` varchar(255) DEFAULT '' COMMENT '合同标题',
  `transaction_id` varchar(64) DEFAULT '' COMMENT '交易号',
  `download_url` varchar(255) DEFAULT '' COMMENT '下载签署后的合同',
  `viewpdf_url` varchar(255) DEFAULT '' COMMENT '查看签署后的合同',
  `result_code` varchar(32) DEFAULT '' COMMENT '签章结果代码',
  `result_desc` varchar(255) DEFAULT '' COMMENT '签章结果描述',
  `msg_digest` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;




CREATE TABLE IF NOT EXISTS `{$prefix}massage_fdd_attestation_record` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `customer_id` varchar(64) DEFAULT '0' COMMENT '用户注册id',
  `transactionNo` varchar(64) DEFAULT '',
  `status` tinyint(3) DEFAULT '1' COMMENT '2代表绑定实名信息',
  `create_time` bigint(11) DEFAULT '0',
  `statusDesc` varchar(625) DEFAULT '',
  `sign` varchar(625) DEFAULT '',
  `result_code` varchar(32) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_fdd_config` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `AppId` varchar(64) DEFAULT '',
  `AppSecret` varchar(125) DEFAULT '',
  `status` tinyint(3) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_order_commission_share` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `comm_id` int(11) DEFAULT NULL,
  `share_balance` int(11) DEFAULT '0',
  `share_cash` decimal(10,2) DEFAULT '0.00',
  `share_id` int(11) DEFAULT '0' COMMENT '被分摊人的id',
  `order_id` int(11) DEFAULT '0' COMMENT '订单id',
  `type` int(11) DEFAULT '0' COMMENT '1技师 2代理商 3平台',
  PRIMARY KEY (`id`),
  KEY `comm_id` (`comm_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_user_channel_bind` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `channel_id` int(11) DEFAULT '0',
  `create_time` bigint(11) DEFAULT '0',
  `over_time` bigint(11) DEFAULT '0',
  `uniacid` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_qr_bind` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `openid` varchar(64) DEFAULT NULL,
  `create_id` int(11) DEFAULT NULL,
  `pid` int(11) DEFAULT '0',
  `create_time` bigint(11) DEFAULT '0',
  `over_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_coach_custom_balance` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `coach_id` int(11) DEFAULT NULL,
  `balance` int(11) DEFAULT '0',
  `start_time` bigint(11) DEFAULT '0',
  `end_time` bigint(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  `is_update` tinyint(3) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_store_cate` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT '',
  `cover` varchar(255) DEFAULT '',
  `top` varchar(255) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_store_cate_connect` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `store_id` int(11) DEFAULT NULL,
  `cate_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_expectation_city_info` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `city` varchar(255) DEFAULT '' COMMENT '期待城市',
  `user_id` int(11) DEFAULT '0' COMMENT '用户id',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='期待城市';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_expectation_city_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `city` varchar(255) DEFAULT '' COMMENT '期待城市',
  `status` tinyint(3) DEFAULT '1' COMMENT '1未开通 2已开通',
  `num` int(11) DEFAULT '0' COMMENT '投票人数',
  `create_time` bigint(11) DEFAULT '0',
  `update_time` bigint(11) DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='期待城市';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_channel_qr` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(125) DEFAULT '' COMMENT '名称',
  `code` varchar(64) DEFAULT '' COMMENT '编码',
  `cate_id` int(11) DEFAULT '0' COMMENT '类目',
  `channel_id` int(11) DEFAULT '0' COMMENT '绑定的渠道商',
  `balance` int(11) DEFAULT '0' COMMENT '分成',
  `qr` varchar(225) DEFAULT '' COMMENT '二维码',
  `qr_img` varchar(255) DEFAULT '' COMMENT '二维码+编码',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='渠道码';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_channel_scan_code_record` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `qr_id` int(11) DEFAULT '0' COMMENT '二维码id',
  `user_id` int(11) DEFAULT '0',
  `create_time` bigint(11) DEFAULT '0',
  `qr_code` varchar(64) DEFAULT '',
  `open_id` varchar(64) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


CREATE TABLE IF NOT EXISTS `{$prefix}shequshop_adapay_bank` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `member_id` varchar(255) DEFAULT NULL,
  `card_id` varchar(255) DEFAULT '' COMMENT '银行卡号',
  `card_name` varchar(255) DEFAULT '' COMMENT '银行卡对应的户名',
  `cert_id` varchar(255) DEFAULT '' COMMENT '证件号，银行账户类型为对私时，必填',
  `cert_type` varchar(255) DEFAULT '00' COMMENT '证件类型，仅支持：00-身份证，银行账户类型为对私时，必填',
  `tel_no` varchar(255) DEFAULT '' COMMENT '手机号',
  `bank_code` varchar(255) DEFAULT '' COMMENT '银行编码，详见附录 银行代码，银行账户类型对公时，必填',
  `bank_name` varchar(255) DEFAULT '' COMMENT '开户银行名称',
  `bank_acct_type` int(11) DEFAULT '2' COMMENT '银行账户类型：1-对公；2-对私',
  `prov_code` varchar(255) DEFAULT '' COMMENT '银行账户开户银行所在省份编码 （省市编码），银行账户类型为对公时，必填',
  `area_code` varchar(255) DEFAULT '' COMMENT '银行账户开户银行所在地区编码（省市编码），银行账户类型为对公时，必填',
  `settle_account_id` varchar(255) DEFAULT NULL,
  `status` tinyint(11) DEFAULT '1',
  `order_member_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


CREATE TABLE IF NOT EXISTS `{$prefix}shequshop_adapay_callback` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT '0',
  `adapay_id` varchar(255) DEFAULT '',
  `status` varchar(255) DEFAULT '',
  `text` text,
  `create_time` bigint(11) DEFAULT '0',
  `type` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;



CREATE TABLE IF NOT EXISTS `{$prefix}shequshop_adapay_config` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `status` tinyint(3) DEFAULT '0',
  `appid` varchar(64) DEFAULT '',
  `api_key_live` varchar(255) DEFAULT '',
  `api_key_test` varchar(255) DEFAULT '',
  `rsa_private_key` text,
  `commission` tinyint(3) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


CREATE TABLE IF NOT EXISTS `{$prefix}shequshop_adapay_member` (
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `obj_id` int(11) DEFAULT '0',
  `type` tinyint(3) DEFAULT '1',
  `member_id` varchar(128) DEFAULT '',
  `order_no` varchar(128) DEFAULT '' COMMENT '请求订单号，只能为英文、数字或者下划线的一种或多种组合，保证在app_id下唯一',
  `card_name` varchar(128) DEFAULT '' COMMENT '银行卡对应的户名',
  `name` varchar(128) DEFAULT '' COMMENT '企业名称',
  `prov_code` varchar(128) DEFAULT '' COMMENT '省份编码',
  `area_code` varchar(128) DEFAULT '3' COMMENT '地区编码 ',
  `social_credit_code` varchar(255) DEFAULT '' COMMENT '统一社会信用码',
  `social_credit_code_expires` varchar(255) DEFAULT '' COMMENT '统一社会信用证有效期',
  `business_scope` varchar(255) DEFAULT '' COMMENT '经营范围',
  `legal_person` varchar(255) DEFAULT '' COMMENT '法人姓名',
  `legal_cert_id` varchar(255) DEFAULT '' COMMENT '法人身份证号码',
  `legal_cert_id_expires` varchar(255) DEFAULT '' COMMENT '法人身份证有效期',
  `legal_mp` varchar(255) DEFAULT '' COMMENT '法人手机号',
  `address` varchar(255) DEFAULT '' COMMENT '企业地址',
  `attach_file` text COMMENT '上传附件，传入的中文文件名称为 UTF-8 字符集 URLEncode 编码后的字符串。内容须包含三证合一证件照、法人身份证正面照、法人身份证反面照、开户银行许可证照。 压缩 zip包后上传，最大限制为 9 M',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  `is_company` tinyint(3) DEFAULT '1' COMMENT '1企业 2私人',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


CREATE TABLE IF NOT EXISTS `{$prefix}shequshop_adapay_pay_record` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_code` varchar(255) DEFAULT '',
  `adapay_id` varchar(255) DEFAULT '',
  `type` varchar(125) DEFAULT '' COMMENT '1支付订单 2升级订单 3退款订单',
  `create_time` bigint(11) DEFAULT '0',
  `adapay_code` varchar(255) DEFAULT '',
  `status` tinyint(3) DEFAULT '1',
  `pay_price` decimal(10,2) DEFAULT '0.00',
  `order_id` int(11) DEFAULT '0',
  `pay_order_id` int(11) DEFAULT '0' COMMENT '退款是的的支付订单',
  `true_price` decimal(10,2) DEFAULT '0.00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


CREATE TABLE IF NOT EXISTS `{$prefix}shequshop_adapay_record` (
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_id` int(11) DEFAULT '0',
  `commission_id` int(11) DEFAULT '0',
  `adapay_id` varchar(128) DEFAULT '',
  `cash` decimal(10,2) DEFAULT '0.00',
  `status` tinyint(3) DEFAULT '1',
  `type` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;



CREATE TABLE IF NOT EXISTS `{$prefix}shequshop_adapay_record` (
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_id` int(11) DEFAULT '0',
  `commission_id` int(11) DEFAULT '0',
  `adapay_id` varchar(128) DEFAULT '',
  `cash` decimal(10,2) DEFAULT '0.00',
  `status` tinyint(3) DEFAULT '1',
  `type` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_member_config` (
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `growth_name` varchar(64) DEFAULT '成长值' COMMENT '成长值名称',
  `growth_value` varchar(32) DEFAULT '0' COMMENT '每消费一元增加多少成长值',
  `growth_limit` tinyint(3) DEFAULT '0' COMMENT '成长值限制',
  `max_growth_day` varchar(32) DEFAULT '0' COMMENT '每日最多获取多少成长值',
  `status` tinyint(3) DEFAULT '1',
  `member_text` longtext COMMENT '会员规则',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_member_coupon` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `level_id` int(11) DEFAULT '0',
  `coupon_id` int(11) DEFAULT '0' COMMENT '优惠券id',
  `num` int(11) DEFAULT '0' COMMENT '数量',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_member_growth` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `type` tinyint(3) DEFAULT '1',
  `is_add` tinyint(3) DEFAULT '1' COMMENT '1是加0是扣',
  `growth` decimal(10,2) DEFAULT '0.00' COMMENT '成长值',
  `order_id` int(11) DEFAULT '0' COMMENT '订单id',
  `before_growth` decimal(10,2) DEFAULT '0.00' COMMENT '核算前成长值',
  `after_growth` decimal(10,2) DEFAULT '0.00' COMMENT '核算后成长值',
  `create_time` bigint(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  `is_up` int(11) DEFAULT '0' COMMENT '如果升级，这里显示等级的id',
  `create_user` int(11) DEFAULT '0' COMMENT '操作者',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_member_level` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(64) DEFAULT '' COMMENT '等级名称',
  `color` varchar(32) DEFAULT '' COMMENT '颜色',
  `growth` decimal(10,2) DEFAULT '0.00' COMMENT '成长值',
  `appoint_service` tinyint(3) DEFAULT '0' COMMENT '指定服务购买',
  `service_discount` tinyint(3) DEFAULT '0' COMMENT '服务项目折扣',
  `member_discount` tinyint(3) DEFAULT '0' COMMENT '升级礼包 送优惠券',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  `top` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_member_rights` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT '' COMMENT '权益名称',
  `show_title` varchar(255) DEFAULT '' COMMENT '权限展示名称',
  `rights_icon` varchar(255) DEFAULT '' COMMENT '图标',
  `rights_text` text COMMENT '权益说明',
  `top` int(11) DEFAULT '0',
  `is_admin` tinyint(3) DEFAULT '0' COMMENT '是否是系统权限',
  `create_time` bigint(11) DEFAULT '0',
  `key` varchar(64) DEFAULT '' COMMENT '系统权益时候的key',
  `status` tinyint(3) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_member_rights_connect` (
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `level_id` int(11) DEFAULT '0' COMMENT '等级id',
  `rights_id` int(11) DEFAULT '0' COMMENT '权益id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_member_service` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `level_id` int(11) DEFAULT '0',
  `service_id` int(11) DEFAULT '0',
  `type` tinyint(3) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_adapay_admin_pay` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `pay_type` int(11) DEFAULT '1',
  `pay_price` decimal(10,2) DEFAULT '0.00',
  `create_time` bigint(11) DEFAULT '0',
  `adapay_id` varchar(225) DEFAULT '',
  `order_code` varchar(255) DEFAULT '',
  `true_price` decimal(10,2) DEFAULT '0.00',
  `pay_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


CREATE TABLE IF NOT EXISTS `{$prefix}shequshop_adapay_accounts_record` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `cash` decimal(10,2) DEFAULT '0.00',
  `pay_id` int(11) DEFAULT '0',
  `create_time` bigint(11) DEFAULT '0',
  `member_id` int(11) DEFAULT NULL,
  `bank_id` int(11) DEFAULT NULL,
  `adapay_member_id` varchar(255) DEFAULT '',
  `adapay_id` varchar(255) DEFAULT '' COMMENT '分账记录的id',
  `settle_account_id` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_coach_cash_update_record` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `coach_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `before_cash` decimal(10,2) DEFAULT '0.00',
  `after_cash` decimal(10,2) DEFAULT '0.00',
  `cash` decimal(10,2) DEFAULT '0.00',
  `create_time` bigint(10) DEFAULT '0',
  `create_user` int(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  `type` tinyint(3) DEFAULT '1',
  `is_add` tinyint(3) DEFAULT '1',
  `text` varchar(1024) DEFAULT '',
  `is_admin` tinyint(3) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;



CREATE TABLE IF NOT EXISTS `{$prefix}massage_action_diy` (
   `id` int(20) NOT NULL AUTO_INCREMENT,
  `diy_name` varchar(50) NOT NULL DEFAULT '' COMMENT 'diy名称',
  `page` mediumtext NOT NULL COMMENT 'diy页面内容',
  `tabbar` text NOT NULL COMMENT 'tabbar配置',
  `status` int(3) NOT NULL DEFAULT '1' COMMENT '1 启用  0未启用',
  `uniacid` int(10) NOT NULL,
  `create_time` int(11) NOT NULL DEFAULT '0',
  `update_time` int(11) NOT NULL DEFAULT '0',
  `is_system` int(3) NOT NULL DEFAULT '0' COMMENT '是否是系统默认',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='diy表';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_member_up_record` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL COMMENT '用户id',
  `level_id` int(11) DEFAULT '0' COMMENT '会员等级id',
  `level` int(11) DEFAULT '0' COMMENT '等级',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='会员升级记录';

CREATE TABLE IF NOT EXISTS `{$prefix}massage_coach_trajectory` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_id` int(11) DEFAULT '0' COMMENT '订单id',
  `coach_id` int(11) DEFAULT '0' COMMENT '技师id',
  `text` longtext COMMENT '技师的轨迹',
  `create_time` bigint(11) DEFAULT '0',
  `update_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='技师轨迹';

CREATE TABLE IF NOT EXISTS `{$prefix}shequshop_adapay_err_log` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `adapay_id` varchar(128) DEFAULT '' COMMENT '分账的id',
  `text` text COMMENT '错误内容',
  `order_id` int(11) DEFAULT '0' COMMENT '订单id',
  `type` varchar(64) DEFAULT '' COMMENT '类型',
  `create_time` bigint(11) DEFAULT '0',
  `comm_id` int(11) DEFAULT '0' COMMENT '佣金记录的id',
  PRIMARY KEY (`id`)
)  ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='分账失败日志';



alter table `{$prefix}massage_fdd_attestation_record` ADD COLUMN `sign` varchar(625) DEFAULT '';

alter table `{$prefix}massage_channel_qr` ADD COLUMN `admin_id` int(11) DEFAULT '0' COMMENT '代理商id';

alter table `{$prefix}massage_channel_list` ADD COLUMN `is_qr` tinyint(3) DEFAULT '0' COMMENT '怎么生成的 1是二维码';

alter table `{$prefix}massage_service_order_commission` ADD COLUMN `channel_qr_id` int(11) DEFAULT '0' COMMENT '渠道商码';

alter table `{$prefix}massage_fdd_agreement_record` ADD COLUMN `end_time` bigint(11) DEFAULT '0';

alter table `{$prefix}massage_service_coach_update` ADD COLUMN `birthday` bigint(11) DEFAULT '0';

alter table `{$prefix}massage_service_coach_list` ADD COLUMN `check_cash` decimal(10,2) DEFAULT '0.00';

alter table `{$prefix}shequshop_school_admin` ADD COLUMN `check_cash` decimal(10,2) DEFAULT '0.00';

alter table `{$prefix}massage_service_up_order_goods_list` ADD COLUMN `material_price` decimal(10,2) DEFAULT '0.00' COMMENT '物料费';

alter table `{$prefix}massage_service_up_order_goods_list` ADD COLUMN `init_material_price` decimal(10,2) DEFAULT '0.00' COMMENT '物料费';

alter table `{$prefix}massage_service_up_order_list` ADD COLUMN `init_material_price` decimal(10,2) DEFAULT '0.00' COMMENT '物料费';

alter table `{$prefix}massage_service_up_order_list` ADD COLUMN `material_price` decimal(10,2) DEFAULT '0.00' COMMENT '物料费';

alter table `{$prefix}massage_service_coach_update` ADD COLUMN `order_num` int(11) DEFAULT '0';

alter table `{$prefix}shequshop_school_admin` ADD COLUMN `merchant_name` varchar(255) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '商户名字';

alter table `{$prefix}massage_service_order_goods_list` ADD COLUMN `init_material_price` decimal(10,2) DEFAULT '0.00' COMMENT '原来的的服务费';

alter table `{$prefix}massage_service_order_list` ADD COLUMN `init_material_price` decimal(10,2) DEFAULT '0.00' COMMENT '原来的的服务费';

alter table `{$prefix}massage_service_wallet_list` ADD COLUMN `is_auto` tinyint(3) DEFAULT '0' COMMENT '是否自动到账';

alter table `{$prefix}massage_service_service_list` ADD COLUMN `is_store` tinyint(3) DEFAULT '0' COMMENT '是否支持到店';

alter table `{$prefix}massage_service_service_list` ADD COLUMN `is_door` tinyint(3) DEFAULT '1' COMMENT '是否支持上门';

alter table `{$prefix}massage_service_service_coach` ADD COLUMN `price` decimal(10,2) DEFAULT '-1.00';

alter table `{$prefix}massage_service_city_list` ADD COLUMN `is_city` tinyint(3) DEFAULT '0';

alter table `{$prefix}massage_service_order_list` ADD COLUMN  `material_type` tinyint(3) DEFAULT '0';

alter table `{$prefix}massage_channel_list` ADD COLUMN  `balance` int(11) DEFAULT '-1';

alter table `{$prefix}massage_aliyun_phone_config` ADD COLUMN  `winnerlook_appid` varchar(128) DEFAULT '' COMMENT '云信appid';

alter table `{$prefix}massage_aliyun_phone_config` ADD COLUMN  `winnerlook_token` varchar(128) DEFAULT '' COMMENT '云信token';

alter table `{$prefix}massage_aliyun_phone_config` ADD COLUMN  `winnerlook_phone_arr` varchar(1024) DEFAULT '';

alter table `{$prefix}massage_user_channel_bind` ADD COLUMN `open_id` varchar(64) DEFAULT '';

alter table `{$prefix}massage_service_coach_update` ADD COLUMN `create_user` int(11) DEFAULT '0';

alter table `{$prefix}massage_short_code_config` ADD COLUMN `bind_phone_type` tinyint(3) DEFAULT '0' COMMENT '绑定手机号方式，默认';

alter table `{$prefix}massage_fdd_attestation_record` ADD COLUMN `type` tinyint(3) DEFAULT '1' COMMENT '1用户 2企业';

alter table `{$prefix}shequshop_school_admin` ADD COLUMN `signature_content` varchar(255) DEFAULT '' COMMENT '印章内容';

alter table `{$prefix}massage_fdd_agreement_record` ADD COLUMN `company_customer_id` varchar(64) DEFAULT '' COMMENT '商家账号id';

alter table `{$prefix}massage_fdd_agreement_record` ADD COLUMN `company_transaction_id` varchar(63) DEFAULT '';

alter table `{$prefix}massage_aliyun_phone_config` ADD COLUMN `moor_virtual_type` tinyint(3) DEFAULT '1';

alter table `{$prefix}massage_service_coach_time_list` ADD COLUMN `is_work` tinyint(3) DEFAULT '1';

alter table `{$prefix}massage_user_channel_bind` ADD COLUMN `channel_qr_code` varchar(64) DEFAULT '' COMMENT '渠道码code';

alter table `{$prefix}massage_user_channel_bind` ADD COLUMN `channel_qr_id` int(11) DEFAULT '0' COMMENT '渠道码id';

alter table `{$prefix}massage_service_order_list` ADD COLUMN `channel_qr_id` int(11) DEFAULT '0' COMMENT '渠道码id';

alter table `{$prefix}massage_send_msg_config` ADD COLUMN `order_service_tmpl_id` varchar(225) DEFAULT '' COMMENT '订单服务相关的通知';

alter table `{$prefix}massage_service_wallet_list` ADD COLUMN `last_login_type` int(11) DEFAULT '2' COMMENT '用户提现的时候是在哪个端';

alter table `{$prefix}massage_service_notice_list` ADD COLUMN `is_pop` tinyint(3) DEFAULT '1' COMMENT '是否弹出过弹窗';

alter table `{$prefix}massage_service_notice_list` ADD COLUMN `is_tmpl` tinyint(3) DEFAULT '0' COMMENT '是否发送过通知';

alter table `{$prefix}massage_service_order_list` ADD COLUMN `is_safe` tinyint(3) DEFAULT '1' COMMENT '该订单是否有跳单风险 1没有 2有';

alter table `{$prefix}massage_service_user_list` ADD COLUMN `growth` decimal(10,2) DEFAULT '0.00' COMMENT '成长值';

ALTER TABLE `{$prefix}massage_service_wallet_list` modify COLUMN `tax_point` decimal(10,2) DEFAULT '0.00' COMMENT '税点';

alter table `{$prefix}massage_service_user_list` ADD COLUMN `member_calculate_time` bigint(11) DEFAULT '0' COMMENT '最近一次的会员核算时间';

ALTER TABLE `{$prefix}shequshop_school_admin` modify COLUMN `cash` decimal(10,2) DEFAULT '0.00' COMMENT '佣金';

ALTER TABLE `{$prefix}massage_member_level` modify COLUMN `growth` int(11) DEFAULT '0' COMMENT '成长值';

ALTER TABLE `{$prefix}massage_store_cate` modify COLUMN `top` int(11) DEFAULT '0';

ALTER TABLE `{$prefix}massage_service_user_list` modify COLUMN `growth` int(11) DEFAULT '0' COMMENT '成长值';

alter table `{$prefix}massage_service_service_list` ADD COLUMN `member_service` tinyint(3) DEFAULT '0' COMMENT '会员商品类型 1会员专享 2会员折扣';

alter table `{$prefix}massage_service_wallet_list` ADD COLUMN `failure_reason` varchar(1024) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '失败原因';

alter table `{$prefix}massage_service_refund_order` ADD COLUMN `failure_reason` varchar(1024) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '失败原因';

alter table `{$prefix}shequshop_adapay_member` ADD COLUMN `failure_reason` varchar(1024) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '失败原因';

alter table `{$prefix}massage_service_wallet_list` ADD COLUMN `adapay_code` varchar(64) DEFAULT '' COMMENT '分账每次都会生成一个code';

alter table `{$prefix}shequshop_adapay_callback` ADD COLUMN `out_trans_id` varchar(255) DEFAULT '' COMMENT '微信单号';

alter table `{$prefix}shequshop_adapay_callback` ADD COLUMN `party_order_id` varchar(255) DEFAULT '' COMMENT '三方单号';

alter table `{$prefix}massage_service_refund_order` ADD COLUMN `have_price` decimal(10,2) DEFAULT '0.00' COMMENT '已经退款多少钱，主要引对多笔退款情况';

alter table `{$prefix}shequshop_adapay_pay_record` ADD COLUMN `pay_record_id` int(11) DEFAULT '0' COMMENT '关联该表的id';

alter table `{$prefix}shequshop_adapay_pay_record` ADD COLUMN `log_id` int(11) DEFAULT '0' COMMENT '订单金额日志的id';

alter table `{$prefix}massage_service_order_price_log` ADD COLUMN `pay_model` tinyint(3) DEFAULT '1' COMMENT '支付方式';

alter table `{$prefix}shequshop_school_admin` ADD COLUMN `wallet_check_auth` tinyint(3) DEFAULT '0' COMMENT '代理商是否有审核提现的权限 1有 0无';

alter table `{$prefix}shequshop_adapay_record` ADD COLUMN `son_order_id` int(11) DEFAULT '0' COMMENT '如果是升级订单，这个id就是升级订单的id';

alter table `{$prefix}massage_service_wallet_list` ADD COLUMN `control_id` int(11) DEFAULT '0' COMMENT '操作人的id';

alter table `{$prefix}massage_service_wallet_list` ADD COLUMN `detail_id` varchar(128) DEFAULT '' COMMENT '微信返回的id';

alter table `{$prefix}shequshop_school_pay_config` ADD COLUMN `wx_certificates` varchar(255) DEFAULT '' COMMENT '微信平台证书';

alter table `{$prefix}massage_order_coach_change_logs` ADD INDEX `order_id` (`order_id`) USING BTREE;

alter table `{$prefix}massage_service_coach_time_list` ADD INDEX `time_str` (`time_str`) USING BTREE;

alter table `{$prefix}massage_service_order_commission` ADD INDEX `order_id` (`order_id`) USING BTREE;

alter table `{$prefix}massage_service_order_commission` ADD INDEX `top_id` (`top_id`) USING BTREE;

alter table `{$prefix}massage_service_order_commission` ADD INDEX `type` (`type`) USING BTREE;

alter table `{$prefix}massage_service_coupon_goods` ADD INDEX `goods_id` (`goods_id`) USING BTREE;

alter table `{$prefix}massage_service_coupon_goods` ADD INDEX `coupon_id` (`coupon_id`) USING BTREE;

alter table `{$prefix}massage_config_setting` ADD INDEX UNIQUE KEY `key` (`key`) USING HASH;

alter table `{$prefix}shequshop_school_admin` ADD COLUMN `car_admin` tinyint(3) DEFAULT '0' COMMENT '技师车费是否归属代理商';

alter table `{$prefix}massage_service_city_list` ADD COLUMN `winner_appid` varchar(64) DEFAULT '' COMMENT '云信应用的appid';

alter table `{$prefix}massage_service_city_list` ADD COLUMN `winner_token` varchar(128) DEFAULT '' COMMENT '云信应用的token';

alter table `{$prefix}massage_aliyun_phone_config` ADD COLUMN `help_tmpl_id` varchar(64) DEFAULT '' COMMENT '求救通知模版id';

alter table `{$prefix}massage_aliyun_phone_config` ADD COLUMN `help_tmpl_text` varchar(255) DEFAULT '你有技师正在发出求救' COMMENT '求救通知模版内容';

alter table `{$prefix}massage_aliyun_phone_config` ADD COLUMN `notice_admin` tinyint(3) DEFAULT '0' COMMENT '有代理商的技师 都不通知平台';

alter table `{$prefix}massage_add_clock_setting` ADD COLUMN `admin_id` int(11) DEFAULT '0' COMMENT '代理商id';

alter table `{$prefix}shequshop_school_admin` ADD COLUMN `clock_cash_status` tinyint(3) DEFAULT '0' COMMENT '加钟设置开关';

alter table `{$prefix}massage_service_order_list_data` ADD COLUMN `pay_point` decimal(10,2) DEFAULT '0.00' COMMENT '支付手续费';

alter table `{$prefix}massage_service_order_list_data` ADD COLUMN `poster_point` decimal(10,2) DEFAULT '0.00' COMMENT '广告手续费';

alter table `{$prefix}massage_service_order_list_data` ADD COLUMN `poster_coach_share` decimal(10,2) DEFAULT '0.00' COMMENT '广告费技师承担';

alter table `{$prefix}massage_service_order_list_data` ADD COLUMN `poster_admin_share` decimal(10,2) DEFAULT '0.00' COMMENT '广告费代理商承担';

alter table `{$prefix}massage_service_order_commission_share` ADD COLUMN `cash_type` int(11) DEFAULT '0' COMMENT '0分摊 1手续费 2广告费';

alter table `{$prefix}shequshop_school_config` ADD COLUMN `wecom_appid` varchar(64) DEFAULT '' COMMENT '企业微信appid';

alter table `{$prefix}shequshop_school_config` ADD COLUMN `wecom_secret` varchar(128) DEFAULT '' COMMENT '企业微信密钥';

alter table `{$prefix}shequshop_school_config` ADD COLUMN `wecom_staff` text CHARACTER SET utf8mb4 COMMENT '企业微信的客服';

alter table `{$prefix}massage_service_order_commission_share` ADD COLUMN `comm_type` int(11) DEFAULT '0' COMMENT '佣金记录的type';

alter table `{$prefix}massage_service_coach_list` ADD COLUMN `credit_value` decimal(10,2) DEFAULT '0.00' COMMENT '信用分 该信用分只用于排序 真实信用分需要自己核算';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_coach_credit_config` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `status` tinyint(3) DEFAULT '0' COMMENT '状态0关闭 1开启',
  `init_value` decimal(10,2) DEFAULT '0.00' COMMENT '信用分初始值',
  `new_protect_day` int(11) DEFAULT '0' COMMENT '新人保护期多少天内',
  `new_protect_value` decimal(10,2) DEFAULT '0.00' COMMENT '新人保护期内的成长值',
  `order_value` decimal(10,2) DEFAULT '0.00' COMMENT '订单金额换算分数/元',
  `order_empty` tinyint(3) DEFAULT '0' COMMENT '订单换算是否周期清空',
  `add_order_value` decimal(10,2) DEFAULT '0.00' COMMENT '加钟订单金额换算分数/元',
  `add_order_empty` tinyint(3) DEFAULT '0' COMMENT '加钟订单换算是否周期清空',
  `time_long_value` decimal(10,2) DEFAULT '0.00' COMMENT '服务时长换算分值',
  `time_long_empty` tinyint(3) DEFAULT '0' COMMENT '服务时长换算是否清空',
  `repeat_order_value` decimal(10,2) DEFAULT '0.00' COMMENT '复购换算',
  `repeat_order_empty` tinyint(3) DEFAULT '0' COMMENT '复购清空',
  `good_evaluate_value` decimal(10,2) DEFAULT '0.00' COMMENT '好评换算',
  `good_evaluate_empty` tinyint(3) DEFAULT '0' COMMENT '好评清空',
  `refund_order_value` decimal(10,2) DEFAULT '0.00' COMMENT '退单换算',
  `refund_order_empty` tinyint(3) DEFAULT '0' COMMENT '退单清空',
  `refuse_order_value` decimal(10,2) DEFAULT '0.00' COMMENT '拒单换算',
  `refuse_order_empty` tinyint(3) DEFAULT '0' COMMENT '拒单清空',
  `bad_evaluate_value` decimal(10,2) DEFAULT '0.000' COMMENT '差评换算',
  `bad_evaluate_empty` tinyint(3) DEFAULT '0' COMMENT '差评清空',
  `distance` decimal(10,2) DEFAULT '0.00' COMMENT '多少公里内使用积分排序',
  `text` text COMMENT '说明',
  PRIMARY KEY (`id`)
)  ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='技师信用分配置';



CREATE TABLE IF NOT EXISTS `{$prefix}massage_coach_credit_record` (
    `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `coach_id` int(11) DEFAULT '0' COMMENT '技师id',
  `value` decimal(10,2) DEFAULT '0.00' COMMENT '信用分',
  `order_id` int(11) DEFAULT '0' COMMENT '订单id',
  `type` int(11) DEFAULT '1' COMMENT '1 订单 2加钟 3服务时长 4复购 5好评 6退单 7拒单 8差评',
  `status` tinyint(3) DEFAULT '1' COMMENT '状态',
  `create_time` bigint(11) DEFAULT '0',
  `order_price` decimal(10,2) DEFAULT '0.00' COMMENT '订单金额',
  PRIMARY KEY (`id`),
  KEY `coach_id` (`coach_id`) USING BTREE
)  ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='技师信用分记录';

CREATE TABLE IF NOT EXISTS `{$prefix}massage_user_comment` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0' COMMENT '用户id',
  `text` text COMMENT '评价内容',
  `coach_id` int(11) DEFAULT '0' COMMENT '技师id',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  `order_id` int(11) DEFAULT '0' COMMENT '订单id',
  PRIMARY KEY (`id`)
)  ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='技师评价用户';



CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_coach_icon` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT '' COMMENT '名称',
  `icon` varchar(255) DEFAULT '' COMMENT '图标',
  `create_time` bigint(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  PRIMARY KEY (`id`)
)  ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='技师图标';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_coach_watermark_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `coach_id` int(11) DEFAULT NULL,
  `type` varchar(32) DEFAULT '' COMMENT '类型',
  `original_img` varchar(255) DEFAULT '' COMMENT '原图片',
  `watermark_img` varchar(255) DEFAULT '' COMMENT '水印图片',
  `watermark_transparent` varchar(32) DEFAULT '' COMMENT '水印图片度',
  PRIMARY KEY (`id`)
)  ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='水印图片';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_coach_broker_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0' COMMENT '关联的用户id',
  `user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '' COMMENT '经纪人名称',
  `mobile` varchar(32) DEFAULT '' COMMENT '电话',
  `status` tinyint(3) DEFAULT '1' COMMENT '1申请中 2通过 4拒绝 3取消 -1删除',
  `create_time` bigint(11) DEFAULT '0' COMMENT '申请时间',
  `text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '备注',
  `sh_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '审核备注',
  `sh_time` bigint(11) DEFAULT '0' COMMENT '审核时间',
  `cash` decimal(10,2) DEFAULT '0.00' COMMENT '当前佣金',
  PRIMARY KEY (`id`)
)  ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='技师经纪人表';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_broker_level` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '' COMMENT '等级名字',
  `inv_num` int(11) DEFAULT '0' COMMENT '邀请技师名字',
  `total_performance` decimal(10,2) DEFAULT '0.00' COMMENT '周期业绩总和',
  `balance` decimal(10,2) DEFAULT '0.00' COMMENT '提成比例',
  `status` tinyint(3) DEFAULT '1' COMMENT '状态1 -1删除',
  `create_time` bigint(11) DEFAULT '0' COMMENT '创建时间',
  `top` int(11) DEFAULT '0' COMMENT '排序值',
  PRIMARY KEY (`id`)
)  ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='经纪人等级';


ALTER TABLE `{$prefix}massage_coach_credit_config` modify COLUMN  `distance` text COMMENT '多少公里内使用积分排序';

ALTER TABLE `{$prefix}massage_coach_credit_config` modify COLUMN  `good_evaluate_value` decimal(10,2) DEFAULT '0.00' COMMENT '好评换算';

ALTER TABLE `{$prefix}massage_service_coach_list` ADD COLUMN `credit_top` int(11) DEFAULT '999' COMMENT '信用分排序用的';

ALTER TABLE `{$prefix}massage_service_coach_list` ADD COLUMN `recommend_icon` tinyint(3) DEFAULT '0' COMMENT '推荐的挂件';

ALTER TABLE `{$prefix}massage_help_notice_config` ADD COLUMN `reminder_admin_status` tinyint(3) DEFAULT '1' COMMENT '来电通知是否通知管理员';

ALTER TABLE `{$prefix}massage_help_notice_config` ADD COLUMN `reminder_notice_admin` tinyint(3) DEFAULT '0' COMMENT '来电通知是否通知平台';
ALTER TABLE `{$prefix}massage_help_notice_config` ADD COLUMN  `short_admin_status` tinyint(3) DEFAULT '1' COMMENT '短信通知是否通知管理员';
ALTER TABLE `{$prefix}massage_help_notice_config` ADD COLUMN  `reminder_notice_phone` text CHARACTER SET utf8mb4 COMMENT '来电通知电话';
ALTER TABLE `{$prefix}massage_help_notice_config` ADD COLUMN  `short_notice_admin` tinyint(3) DEFAULT '0' COMMENT '短信通知是否通知平台';
ALTER TABLE `{$prefix}massage_help_notice_config` ADD COLUMN  `tmpl_admin_status` tinyint(3) DEFAULT '1' COMMENT '模版消息是否通知管理员';
ALTER TABLE `{$prefix}massage_help_notice_config` ADD COLUMN  `tmpl_notice_admin` tinyint(3) DEFAULT '0' COMMENT '模版消息是否通知平台';

ALTER TABLE `{$prefix}massage_short_code_config` ADD COLUMN  `winner_order_text` varchar(255) DEFAULT '' COMMENT '云信下单通知内容';

ALTER TABLE `{$prefix}massage_short_code_config` ADD COLUMN  `winner_refund_text` varchar(255) DEFAULT '' COMMENT '云信退款通知内容';

ALTER TABLE `{$prefix}massage_short_code_config` ADD COLUMN  `winner_police_text` varchar(255) DEFAULT '' COMMENT '云信求救通知内容';

ALTER TABLE `{$prefix}massage_short_code_config` ADD COLUMN  `winner_code_text` varchar(255) DEFAULT '' COMMENT '云信验证码通知内容';
ALTER TABLE `{$prefix}massage_short_code_config` ADD COLUMN  `winner_user` varchar(255) DEFAULT '' COMMENT '云信短信登录账号';
ALTER TABLE `{$prefix}massage_short_code_config` ADD COLUMN  `winner_pass` varchar(255) DEFAULT '' COMMENT '云信短信登录密码';

ALTER TABLE `{$prefix}shequshop_adapay_config` ADD COLUMN  `pay_mode` tinyint(3) DEFAULT '1' COMMENT '是否分账 1分账 2不分账';

ALTER TABLE `{$prefix}shequshop_adapay_config` ADD COLUMN  `point` decimal(10,2) DEFAULT '0.00' COMMENT '手续费';

ALTER TABLE `{$prefix}shequshop_adapay_pay_record` ADD COLUMN `pay_mode` tinyint(3) DEFAULT '1' COMMENT '是否分账2不分 1分账';

ALTER TABLE `{$prefix}massage_service_coach_list` ADD COLUMN `free_fare_distance` varchar(32) DEFAULT NULL COMMENT '多少公里范围内免车费';

ALTER TABLE `{$prefix}massage_service_coach_update` ADD COLUMN `free_fare_distance` decimal(10,2) DEFAULT '0.00' COMMENT '多少公里范围内免车费';

ALTER TABLE `{$prefix}massage_service_user_list` ADD COLUMN `user_status` tinyint(3) DEFAULT '1' COMMENT '用户状态 -1表示被平台拉黑';

ALTER TABLE `{$prefix}massage_service_coach_level` ADD COLUMN `online_change_integral_status` tinyint(3) DEFAULT '0' COMMENT '在线时长转换积分';

ALTER TABLE `{$prefix}massage_service_coach_level` ADD COLUMN `online_change_integral` decimal(10,2) DEFAULT '0.00' COMMENT '在线时长转换积分/小时换多少积分';

ALTER TABLE `{$prefix}massage_service_user_label_data` ADD COLUMN  `comment_id` int(11) DEFAULT NULL COMMENT '评价id';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN  `free_fare` tinyint(3) DEFAULT '0' COMMENT '车费是否免费 0不免费 1免费平台承担 2技师承担';

ALTER TABLE `{$prefix}massage_service_coach_feedback` ADD COLUMN `type` tinyint(3) DEFAULT '1' COMMENT '1用户 2技师';

ALTER TABLE `{$prefix}massage_service_coach_feedback` ADD COLUMN `true_coach_id` int(11) DEFAULT '0';

ALTER TABLE `{$prefix}massage_service_city_list` ADD COLUMN `skill_service_balance` decimal(10,2) DEFAULT '0.00' COMMENT '技术服务费比例 只扣技师';

ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN `coach_check_auth` tinyint(3) DEFAULT '0' COMMENT '代理商技师审核权限';

ALTER TABLE `{$prefix}massage_service_coach_list` ADD COLUMN `show_salenum` tinyint(3) DEFAULT '1' COMMENT '是否显示销量';

ALTER TABLE `{$prefix}massage_service_coach_update` ADD COLUMN `show_salenum` tinyint(3) DEFAULT '1' COMMENT '是否显示销量';

ALTER TABLE `{$prefix}massage_service_service_list` ADD COLUMN `show_salenum` tinyint(3) DEFAULT '1' COMMENT '是否显示销量';

ALTER TABLE `{$prefix}massage_service_order_list_data` ADD COLUMN `comm_coach_balance` decimal(10,2) DEFAULT '0.00' COMMENT '储值扣款';

ALTER TABLE `{$prefix}massage_service_order_list_data` ADD COLUMN `skill_balance` decimal(10,2) DEFAULT '0.00' COMMENT '技术服务费';

ALTER TABLE `{$prefix}massage_service_coach_list` ADD COLUMN `coach_icon` int(11) DEFAULT '0' COMMENT '技师图标id';

ALTER TABLE `{$prefix}massage_add_clock_setting` ADD COLUMN `type` tinyint(3) DEFAULT '0' COMMENT '0 无差别 1 根据技师等级';

ALTER TABLE `{$prefix}massage_config` ADD COLUMN `clock_cash_type` tinyint(3) DEFAULT '0' COMMENT '0 无差别 1 根据技师等级';

ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN `clock_cash_type` tinyint(3) DEFAULT '0' COMMENT '0 无差别 1 根据技师等级';

ALTER TABLE `{$prefix}massage_service_coupon` ADD COLUMN `admin_id` int(11) DEFAULT '0' COMMENT '代理商id 平台为0';

ALTER TABLE `{$prefix}massage_service_coupon_record` ADD COLUMN `admin_id` int(11) DEFAULT '0' COMMENT '代理商id 平台为0';
ALTER TABLE `{$prefix}massage_help_notice_config` ADD COLUMN `order_tmpl_agent_status` tinyint(3) DEFAULT '0' COMMENT '下单是否通知代理商';
ALTER TABLE `{$prefix}massage_help_notice_config` ADD COLUMN `order_tmpl_admin_status` tinyint(3) DEFAULT '0' COMMENT '下单模版消息是否通知代理商';
ALTER TABLE `{$prefix}massage_help_notice_config` ADD COLUMN `order_tmpl_notice_admin` tinyint(3) DEFAULT '0' COMMENT '下单模版消息是否通知平台';
ALTER TABLE `{$prefix}massage_help_notice_config` ADD COLUMN `order_tmpl_text` text COMMENT '下单模版消息通知人员';
ALTER TABLE `{$prefix}massage_channel_list` ADD COLUMN `controller` int(11) DEFAULT '0' COMMENT '添加人id，用户申请为0';
ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN `coupon_auth` tinyint(3) DEFAULT '0' COMMENT '是否有送优惠券的权限 1有 0无';
ALTER TABLE `{$prefix}massage_help_notice_config` modify COLUMN  `help_phone` text COMMENT '求救电话';
ALTER TABLE `{$prefix}massage_service_coach_time_list` modify COLUMN  `time_str` bigint(11) DEFAULT '0' COMMENT '开始时间戳';
ALTER TABLE `{$prefix}massage_service_coach_time_list` modify COLUMN  `time_str_end` bigint(11) DEFAULT '0' COMMENT '结束时间戳';
ALTER TABLE `{$prefix}massage_service_coach_list` modify COLUMN   `free_fare_distance` decimal(10,2) DEFAULT '0.00' COMMENT '多少公里范围内免车费';
ALTER TABLE `{$prefix}massage_service_order_commission_share` modify COLUMN  `share_balance` varchar(32) DEFAULT '0';

ALTER TABLE `{$prefix}massage_service_user_list` modify COLUMN  `nickName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '';
ALTER TABLE `{$prefix}massage_service_user_list` modify COLUMN  `phone` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '';

ALTER TABLE `{$prefix}massage_service_service_list` modify COLUMN  `com_balance` decimal(10,2) DEFAULT '0.00' COMMENT '分销比例';

ALTER TABLE `{$prefix}massage_service_order_commission` modify COLUMN  `balance` double(10,2) DEFAULT '0.00';

ALTER TABLE `{$prefix}massage_service_order_commission_goods` modify COLUMN  `balance` double(10,2) DEFAULT '0.00';

ALTER TABLE `{$prefix}massage_channel_qr` ADD COLUMN `cost` decimal(10,2) DEFAULT '0.00' COMMENT '成本';
ALTER TABLE `{$prefix}massage_channel_qr` ADD COLUMN `start_time` bigint(11) DEFAULT '0' COMMENT '开始时间';
ALTER TABLE `{$prefix}massage_channel_qr` ADD COLUMN `end_time` bigint(11) DEFAULT '0' COMMENT '结束时间';
ALTER TABLE `{$prefix}massage_channel_qr` ADD COLUMN `text` text COMMENT '备注';
ALTER TABLE `{$prefix}massage_channel_qr` ADD COLUMN `lng` varchar(32) DEFAULT '' COMMENT '经度';
ALTER TABLE `{$prefix}massage_channel_qr` ADD COLUMN `lat` varchar(32) DEFAULT '' COMMENT '纬度';
ALTER TABLE `{$prefix}massage_channel_qr` ADD COLUMN `city` varchar(64) DEFAULT '' COMMENT '经纬度对应的城市名称';
ALTER TABLE `{$prefix}massage_channel_qr` ADD COLUMN `province` varchar(64) DEFAULT '' COMMENT '经纬度对应的省名称';
ALTER TABLE `{$prefix}massage_channel_qr` ADD COLUMN `area` varchar(64) DEFAULT '' COMMENT '经纬度对应的区名称';
ALTER TABLE `{$prefix}massage_channel_scan_code_record` ADD COLUMN `is_new` tinyint(3) DEFAULT '0' COMMENT '新用户扫码';
ALTER TABLE `{$prefix}massage_channel_scan_code_record` ADD COLUMN `province` varchar(64) DEFAULT '' COMMENT '扫码时候所在省份';
ALTER TABLE `{$prefix}massage_channel_scan_code_record` ADD COLUMN `city` varchar(64) DEFAULT '' COMMENT '扫码时候所在城市';
ALTER TABLE `{$prefix}massage_channel_scan_code_record` ADD COLUMN `is_location` tinyint(3) DEFAULT '0' COMMENT '是否在注册地扫码 1是 2否';
ALTER TABLE `{$prefix}massage_channel_scan_code_record` ADD COLUMN `have_loaction` tinyint(3) DEFAULT '1' COMMENT '是否定位过';
ALTER TABLE `{$prefix}massage_wx_upload` ADD COLUMN `coach_key` varchar(255) DEFAULT '' COMMENT '技师端密钥';
ALTER TABLE `{$prefix}massage_wx_upload` ADD COLUMN `coach_version` varchar(32) DEFAULT '' COMMENT '技师端版本号';
ALTER TABLE `{$prefix}massage_wx_upload` ADD COLUMN `coach_content` varchar(1024) DEFAULT '' COMMENT '技师端版本描述';
ALTER TABLE `{$prefix}massage_service_coach_list` ADD COLUMN `true_lng` varchar(32) DEFAULT '' COMMENT '技师真实的经度';
ALTER TABLE `{$prefix}massage_service_coach_list` ADD COLUMN `true_lat` varchar(32) DEFAULT '' COMMENT '技师真实的纬度';
ALTER TABLE `{$prefix}massage_channel_scan_code_record` ADD COLUMN `type` int(11) DEFAULT '1' COMMENT '1渠道码 2分销码 3合伙人邀请技师码';
ALTER TABLE `{$prefix}massage_service_user_list` ADD COLUMN  `is_qr` tinyint(3) DEFAULT '0' COMMENT '是否扫码注册 0否 1是';

ALTER TABLE `{$prefix}massage_help_notice_config` ADD COLUMN  `help_reminder_agent_status` tinyint(3) DEFAULT '1' COMMENT '求救通知来电通知是否通知代理商';
ALTER TABLE `{$prefix}massage_help_notice_config` ADD COLUMN  `help_short_agent_status` tinyint(3) DEFAULT '1' COMMENT '求救通知短信通知是否通知代理商';
ALTER TABLE `{$prefix}massage_help_notice_config` ADD COLUMN  `help_wechat_agent_status` tinyint(3) DEFAULT '1' COMMENT '求救通知微信模版消息通知是否通知代理商';
ALTER TABLE `{$prefix}massage_salesman_list` ADD COLUMN  `balance` decimal(10,2) DEFAULT '-1.00' COMMENT '提成比例 小于0不设置';
ALTER TABLE `{$prefix}massage_channel_qr` ADD COLUMN  `salesman_id` int(11) DEFAULT '0' COMMENT '业务员id';

ALTER TABLE `{$prefix}massage_salesman_list` ADD COLUMN  `inv_channel_balance` decimal(10,2) DEFAULT '-1.00' COMMENT '邀请渠道商渠道商的比例';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN  `version` int(11) DEFAULT '0' COMMENT '一个版本号，主要用于不能兼容的数据';

ALTER TABLE `{$prefix}massage_service_refund_order` ADD COLUMN  `is_admin_apply` tinyint(3) DEFAULT '0' COMMENT '是否是平台申请退款 1是 0不是';

ALTER TABLE `{$prefix}massage_service_refund_order` ADD COLUMN  `check_user` int(11) DEFAULT '0' COMMENT '退款审批账号id';

ALTER TABLE `{$prefix}massage_service_order_list_data` ADD COLUMN  `add_flow_path` tinyint(3) DEFAULT '1' COMMENT '加钟流程 1正常 2简约';

ALTER TABLE `{$prefix}massage_coach_cash_update_record` ADD COLUMN  `info_id` int(11) DEFAULT '0' COMMENT '异常订单时候的info_id';

ALTER TABLE `{$prefix}massage_service_refund_order` ADD COLUMN  `check_user_mobile` tinyint(3) DEFAULT '0' COMMENT '是否是手机管理员退到款';

ALTER TABLE `{$prefix}massage_distribution_list` ADD COLUMN  `balance` decimal(10,2) DEFAULT '-1.00' COMMENT '一级分销提成';

ALTER TABLE `{$prefix}massage_distribution_list` ADD COLUMN  `level_balance` decimal(10,2) DEFAULT '-1.00' COMMENT '二级分销提成';

ALTER TABLE `{$prefix}massage_service_service_list` ADD COLUMN  `level_balance` decimal(10,2) DEFAULT '0.00' COMMENT '二级分销比例';

ALTER TABLE `{$prefix}massage_service_order_commission` ADD COLUMN  `broker_id` int(11) DEFAULT '0' COMMENT '技师经纪人id type9的时候才有';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN  `broker_id` int(11) DEFAULT '0' COMMENT '技师经纪人id';

alter table `{$prefix}massage_service_refund_order` ADD COLUMN  `broker_id` int(11) DEFAULT '0' COMMENT '技师经纪人id';

alter table `{$prefix}massage_service_coach_list` ADD COLUMN  `broker_id` int(11) DEFAULT '0' COMMENT '技师经纪人id';

alter table `{$prefix}shequshop_school_admin` ADD COLUMN  `reseller_auth` tinyint(3) DEFAULT '0' COMMENT '分销员权限 1可以邀请 0不能';

alter table `{$prefix}massage_service_order_commission` ADD COLUMN  `reseller_id` int(11) DEFAULT '-1' COMMENT '分销员id type=1和14的时候才有';

alter table `{$prefix}massage_distribution_list` ADD COLUMN  `pid` int(11) DEFAULT '0' COMMENT '上级分销员id';

alter table `{$prefix}massage_service_order_commission` ADD COLUMN  `sub_reseller_id` int(11) DEFAULT '0' COMMENT '下级分销员id 只有type=14 才有';

alter table `{$prefix}massage_distribution_list` ADD COLUMN  `admin_id` int(11) DEFAULT '0' COMMENT '代理商id';

alter table `{$prefix}massage_service_wallet_list` ADD COLUMN  `check` tinyint(3) DEFAULT '0' COMMENT '这只是一个备用字段 无实际意义 可以无视';

alter table `{$prefix}massage_channel_list` ADD INDEX  `user_id` (`user_id`) USING BTREE;

alter table `{$prefix}massage_distribution_list` ADD COLUMN `del_time` bigint(11) DEFAULT '0' COMMENT '删除时间';

alter table `{$prefix}massage_distribution_list` ADD COLUMN `del_cash` decimal(10,2) DEFAULT '0.00' COMMENT '删除时候还剩的佣金';

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_abnormal_order_info` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0' COMMENT '操作人 0平台',
  `user_type` tinyint(3) DEFAULT '1' COMMENT '1角色 2账号 3代理商',
  `order_id` int(11) DEFAULT '0' COMMENT '订单id',
  `process_id` int(11) DEFAULT '0' COMMENT '流程id',
  `deduct_cash` decimal(10,2) DEFAULT '0.00' COMMENT '扣款金额',
  `status` tinyint(3) DEFAULT '1' COMMENT '1待审核 2同意 3拒绝',
  `text` text COMMENT '审核意见',
  `create_time` bigint(11) DEFAULT '0' COMMENT '提交时间',
  `update_time` bigint(3) DEFAULT '0' COMMENT '修改时间',
  `pass_type` tinyint(3) DEFAULT '0' COMMENT '1同意 2拒绝 0普通非流转设置',
  `top` int(11) DEFAULT '0' COMMENT '用于排序 升序',
  `is_default` tinyint(3) DEFAULT '0' COMMENT '标记异常订单的时候的一个默认状态',
  `is_cancel` tinyint(3) DEFAULT '0' COMMENT '是否拒绝 如果拒绝过会走流转设置流程',
  PRIMARY KEY (`id`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='异常订单审核详情';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_abnormal_order_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_id` int(11) DEFAULT NULL COMMENT '订单id',
  `type` int(11) DEFAULT '0' COMMENT '异常类型 1技师拒单、2超时接单、3客户差评、4行为规范、5话术规范、6客户投诉、7退车费、8到达后取消、9订单取消、10私收小费、11用户退款、12分城市提交、13其他',
  `status` tinyint(3) DEFAULT '1' COMMENT '最终状态 1待处理 2通过 3未通过',
  `deduct_cash` decimal(10,2) DEFAULT '0.00' COMMENT '扣除金额',
  `is_deduct` tinyint(3) DEFAULT '0' COMMENT '是否已经扣款',
  `customer_text` text COMMENT '客服处理意见',
  `create_time` bigint(11) DEFAULT '0' COMMENT '订单创建时间',
  `end_time` bigint(11) DEFAULT '0' COMMENT '最终完成时间',
  `process_id` int(11) DEFAULT '0' COMMENT '当前流程id',
  `bad_text` text COMMENT '差评原因',
  `first_time` bigint(11) DEFAULT '0' COMMENT '首次处理时间',
  `pass_type` tinyint(3) DEFAULT '0' COMMENT '1同意 2拒绝 0普通非流转设置',
  `is_cancel` tinyint(3) DEFAULT '0' COMMENT '是否拒绝 如果拒绝过会走流转设置流程',
  `first_cancel` tinyint(3) DEFAULT '0' COMMENT '是否以一个流程就拒绝了',
  `is_handle` tinyint(3) DEFAULT '0' COMMENT '是否已经处理 0未处理 1已处理',
  `user_id` int(11) DEFAULT '0' COMMENT '标记异常的人的id',
  `end_user_id` int(11) DEFAULT '0' COMMENT '最终处理人',
  PRIMARY KEY (`id`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='异常订单';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_abnormal_order_process` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `top` int(11) DEFAULT '0' COMMENT '流程顺序排序值',
  `status` tinyint(3) DEFAULT '1',
  `deduct_status` tinyint(3) DEFAULT '0' COMMENT '是否有扣款权限 1有 0无',
  `type` tinyint(3) DEFAULT '1' COMMENT '1平台 2代理商',
  `create_time` bigint(11) DEFAULT '0' COMMENT '创建时间',
  `update_time` bigint(11) DEFAULT '0' COMMENT '修改时间',
  `sub_type` tinyint(3) DEFAULT '1' COMMENT '1任意人审核进入下环节 2所有人审核',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COMMENT='异常订单流程';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_abnormal_order_role` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `process_id` int(11) DEFAULT '0' COMMENT '流程id',
  `type` tinyint(3) DEFAULT '1' COMMENT '1 角色 2账号 3代理商',
  `user_id` int(11) DEFAULT '0' COMMENT '角色或者代理商id',
  `process_type` tinyint(3) DEFAULT '1' COMMENT '流程类型 1平台 2代理商',
  `wander_id` int(11) DEFAULT '0' COMMENT '流转设置id',
  `pass_type` tinyint(3) DEFAULT '0' COMMENT '1同意 2拒绝 0普通非流转设置',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='异常订单流程关联角色';

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_abnormal_order_wander` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `process_id` int(11) DEFAULT '0' COMMENT '流程id',
  `pass_type` tinyint(3) DEFAULT '1' COMMENT '1同意 2拒绝',
  `deduct_status` tinyint(3) DEFAULT '0' COMMENT '是否有扣款权限 1有 0无',
  `status` tinyint(3) DEFAULT '1' COMMENT '1开启0关闭',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='异常订单更多属性';

alter table `{$prefix}massage_service_abnormal_order_info` ADD COLUMN `sub_type` tinyint(3) DEFAULT '1' COMMENT '1任意人审核进入下环节 2所有人审核';

alter table `{$prefix}massage_service_abnormal_order_list` ADD COLUMN `info_id` int(11) DEFAULT '0' COMMENT '当前处理的进度id';

alter table `{$prefix}massage_distribution_list` ADD COLUMN `reseller_level` tinyint(3) DEFAULT '0' COMMENT '分销员等级 付费插件的时候使用 1一级 2二级 0无等级';
ALTER TABLE `{$prefix}massage_service_order_list` modify COLUMN `serout_address` varchar(225) DEFAULT '';

CREATE TABLE IF NOT EXISTS `{$prefix}massage_payreseller_order_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0' COMMENT '用户id',
  `reseller_id` int(11) DEFAULT '0' COMMENT '分销员id',
  `pay_type` tinyint(3) DEFAULT '1' COMMENT '1待支付 2已经支付 -1 取消',
  `pay_price` decimal(10,2) DEFAULT '0.00' COMMENT '支付价格',
  `order_code` varchar(64) DEFAULT '' COMMENT '订单号',
  `type` tinyint(3) DEFAULT '2' COMMENT '1一级 2二级',
  `transaction_id` varchar(64) DEFAULT '' COMMENT '商户单号',
  `create_time` bigint(11) DEFAULT '0' COMMENT '下单时间',
  `pay_time` bigint(11) DEFAULT '0' COMMENT '付款时间',
  `pay_model` tinyint(3) DEFAULT '0' COMMENT '支付方式 1微信 2余额 3支付宝',
  `app_pay` tinyint(3) DEFAULT '0' COMMENT '是否是app支付',
  `top_user_id` int(11) DEFAULT '0' COMMENT '推荐人的用户id',
  `top_reseller_id` int(11) DEFAULT '0' COMMENT '推荐人的分销id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='分销员付款订单';



CREATE TABLE IF NOT EXISTS `{$prefix}massage_coach_address` (
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `coach_id` int(11) DEFAULT '0' COMMENT '技师id',
  `lng` varchar(32) DEFAULT '' COMMENT '纬度',
  `lat` varchar(32) DEFAULT '' COMMENT '经度',
  `address` varchar(255) DEFAULT '' COMMENT '详细地址',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='技师地址表';

alter table `{$prefix}massage_role_list` ADD COLUMN `admin_id` int(11) DEFAULT '0' COMMENT '代理商id';

alter table `{$prefix}massage_role_node` ADD COLUMN `admin_id` int(11) DEFAULT '0' COMMENT '代理商id';

alter table `{$prefix}shequshop_school_admin` ADD COLUMN  `admin_id` int(11) DEFAULT '0' COMMENT '代理商id哪个代理商开的账号';
alter table `{$prefix}massage_service_refund_order` ADD COLUMN  `refund_car_price` decimal(10,2) DEFAULT '-1.00' COMMENT '已经退款的车费';
alter table `{$prefix}massage_service_refund_order` ADD COLUMN  `version` int(11) DEFAULT '1' COMMENT '版本号用于迭代';
alter table `{$prefix}massage_qr_bind` ADD COLUMN  `forever` tinyint(3) DEFAULT '1' COMMENT '是否是永久绑定 1永久 0时间限制';
alter table `{$prefix}massage_service_order_comment` ADD COLUMN  `is_good` tinyint(3) DEFAULT '0' COMMENT '是否是优质评价 1是 0不是';
alter table `{$prefix}massage_order_coach_change_logs` ADD COLUMN  `control_id` int(11) DEFAULT '1' COMMENT '操作人id';
alter table `{$prefix}massage_order_coach_change_logs` ADD COLUMN  `control_type` int(11) DEFAULT '1' COMMENT '1 后端 2手机端';
alter table `{$prefix}shequshop_adapay_config` ADD COLUMN `draw_cash_type` varchar(32) DEFAULT 'T1' COMMENT '转账到账时间';
alter table `{$prefix}massage_service_car_price` ADD COLUMN  `cash_type` tinyint(3) DEFAULT '1' COMMENT '计价方式 1默认 2叠加';
alter table `{$prefix}massage_service_car_price` ADD COLUMN  `car_price_start` varchar(32) DEFAULT '00:00' COMMENT '车费白天开始时间';
alter table `{$prefix}massage_service_car_price` ADD COLUMN  `car_price_end` varchar(32) DEFAULT '24:00' COMMENT '车费白天结束时间';
alter table `{$prefix}massage_service_car_price` ADD COLUMN  `distance_free_night` double(11,2) DEFAULT '0.00' COMMENT '夜间多少公里免费';
alter table `{$prefix}massage_service_car_price` ADD COLUMN  `start_price_night` double(11,2) DEFAULT '0.00' COMMENT '夜间起步价';
alter table `{$prefix}massage_service_car_price` ADD COLUMN  `distance_price_night` double(11,2) DEFAULT '0.00' COMMENT '夜间每公里多少钱';
alter table `{$prefix}massage_service_car_price` ADD COLUMN  `cash_type_night` tinyint(3) DEFAULT '1' COMMENT '夜间计价方式 1默认 2叠加';
alter table `{$prefix}massage_service_car_price` ADD COLUMN  `start_distance_night` double(10,2) DEFAULT '0.00' COMMENT '夜间起步距离';

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_car_cash_type` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `config_id` int(11) DEFAULT '0' COMMENT '车费配置id',
  `km` double(10,2) DEFAULT '0.00' COMMENT '多少公里内',
  `cash` decimal(10,2) DEFAULT '0.00' COMMENT '元/km',
  `type` tinyint(3) DEFAULT '1' COMMENT '1日间2夜间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='车费叠加配置表';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_btn_config` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `text` varchar(32) DEFAULT '' COMMENT '服务名称',
  `btn_color` varchar(32) DEFAULT '' COMMENT '按钮背景色',
  `font_color` varchar(32) DEFAULT '' COMMENT '文字颜色',
  `type` int(11) DEFAULT '1' COMMENT '1可服务 2服务中 3可预约 4不可预约',
  PRIMARY KEY (`id`),
  UNIQUE KEY `type` (`uniacid`,`type`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='服务状态按钮配置表';

alter table `{$prefix}massage_aliyun_phone_config` ADD COLUMN  `order_end_tmpl_id` varchar(32) DEFAULT '' COMMENT '到钟语音提醒';

alter table `{$prefix}massage_aliyun_phone_config` ADD COLUMN  `order_end_tmpl_text` varchar(255) DEFAULT '' COMMENT '到钟语音提醒内容';

alter table `{$prefix}massage_aliyun_phone_config` ADD COLUMN   `order_end_status` tinyint(3) DEFAULT '0' COMMENT '到钟提醒开关';

alter table `{$prefix}massage_aliyun_reminder_record` ADD COLUMN  `type` tinyint(3) DEFAULT '1' COMMENT '1未接单通知记录 2到钟通知记录';

alter table `{$prefix}massage_channel_list` ADD COLUMN  `time_type` tinyint(3) DEFAULT '0' COMMENT '0全局 1单独';

alter table `{$prefix}massage_channel_list` ADD COLUMN  `time` int(11) DEFAULT '0' COMMENT '时效性/小时';

alter table `{$prefix}massage_service_refund_order` ADD COLUMN  `refund_service_price` decimal(10,2) DEFAULT '-1.00' COMMENT '实际退款服务费 需要兼容';

alter table `{$prefix}massage_service_refund_order` ADD COLUMN  `refund_material_price` decimal(10,2) DEFAULT '-1.00' COMMENT '实际退款物料费 需要兼容';

alter table `{$prefix}massage_service_order_list` ADD COLUMN  `start_material_price` decimal(10,2) DEFAULT '-1.00' COMMENT '抵扣了优惠，但是包含退款的物料费';

alter table `{$prefix}massage_service_order_commission` ADD COLUMN  `is_init` tinyint(3) DEFAULT '0' COMMENT '兼容数据 车费初始化来的就是1';

alter table `{$prefix}massage_service_up_order_list` ADD COLUMN  `app_pay` tinyint(3) DEFAULT '2' COMMENT '在哪个端支付的 0小程序 1app 2h5';

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_up_refund_order` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_id` int(11) DEFAULT '0' COMMENT '升级订单的id',
  `order_code` varchar(64) DEFAULT '' COMMENT '订单号',
  `status` int(11) DEFAULT '1' COMMENT '状态 1申请中 2成功 3拒绝 4退款中 5失败',
  `apply_price` decimal(10,2) DEFAULT '0.00' COMMENT '申请退款的金额',
  `refund_price` decimal(10,2) DEFAULT '0.00' COMMENT '实际退款金额',
  `create_time` bigint(11) DEFAULT '0' COMMENT '申请时间',
  `refund_time` bigint(11) DEFAULT '0' COMMENT '退款时间',
  `failure_reason` varchar(255) DEFAULT '' COMMENT '失败原因',
  `have_price` decimal(10,2) DEFAULT '0.00' COMMENT '已经退款多少',
  `transaction_id` varchar(64) DEFAULT '' COMMENT '微信返回的单号',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='升级订单退款';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_position_connect` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `service_id` int(11) DEFAULT '0' COMMENT '服务id',
  `position_id` int(11) DEFAULT '0' COMMENT '部位id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_service_position_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT '' COMMENT '名称',
  `status` tinyint(3) DEFAULT '1' COMMENT '状态',
  `create_time` bigint(11) DEFAULT '0',
  `top` int(11) DEFAULT '0' COMMENT '排序值',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='服务部位';

ALTER TABLE `{$prefix}massage_channel_list` modify COLUMN `balance` varchar(32) DEFAULT '-1';

ALTER TABLE `{$prefix}massage_channel_qr` modify COLUMN `balance` varchar(32) DEFAULT '-1';

ALTER TABLE `{$prefix}massage_config` modify COLUMN `balance_balance` varchar(32) DEFAULT '100' COMMENT '返回的比例';

CREATE TABLE IF NOT EXISTS `{$prefix}massage_coach_account_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `coach_id` int(11) DEFAULT '0' COMMENT '技师id',
  `user_name` varchar(64) DEFAULT '' COMMENT '账号',
  `pass_word` varchar(64) DEFAULT '' COMMENT '密码',
  `pass_word_text` varchar(64) DEFAULT '' COMMENT '解析了的密码',
  `status` tinyint(3) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='技师账号';

ALTER TABLE `{$prefix}massage_service_refund_order` ADD COLUMN `type` tinyint(3) DEFAULT '1' COMMENT '1普通退款 2技师据单';

ALTER TABLE `{$prefix}massage_service_user_list` ADD COLUMN `source_type` int(11) DEFAULT '0' COMMENT '0关注公众号添加扫码记录 type 1渠道码 2分销码 3经纪人邀请技-师码 4代理商邀请技-师 5代理商邀请业务员 6代理商邀请渠道商 7技师邀请充值 8业务员邀请渠道商 9渠道商默认码 10分销员邀请分销员 11代理商邀请分销员';

ALTER TABLE `{$prefix}massage_channel_scan_code_record` ADD COLUMN `v` tinyint(3) DEFAULT '0';

ALTER TABLE `{$prefix}massage_service_user_list` ADD COLUMN `area` varchar(255) DEFAULT '' COMMENT '区';
ALTER TABLE `{$prefix}massage_channel_scan_code_record` ADD COLUMN `wechat_type` tinyint(3) DEFAULT '0' COMMENT '扫码对象被取消授权 该值为原有的type';

ALTER TABLE `{$prefix}massage_channel_scan_code_record` ADD COLUMN `is_qr` int(11) DEFAULT '1' COMMENT '0链接 1扫码';

ALTER TABLE `{$prefix}massage_service_coach_list` ADD COLUMN `type_id` int(11) DEFAULT '0' COMMENT '技师类型';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_coach_type_list` (
    `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT '',
  `top` int(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


ALTER TABLE `{$prefix}massage_service_coach_update` ADD COLUMN `type_id` int(11) DEFAULT '0' COMMENT '技师类型';

ALTER TABLE `{$prefix}massage_service_order_list` modify COLUMN `text` varchar(625) CHARACTER SET utf8mb4 DEFAULT '';

CREATE TABLE IF NOT EXISTS `{$prefix}massage_addclock_balance_config` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `type` int(11) DEFAULT '1' COMMENT '1分销员 2经纪人 3业务员 4渠道商',
  `balance` decimal(10,2) DEFAULT '0.00' COMMENT '比列',
  `add` tinyint(3) DEFAULT '1' COMMENT '1加 2减',
  `status` tinyint(3) DEFAULT '1',
  `admin_id` int(11) DEFAULT '0' COMMENT '代理商id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='加钟提成分销比例表';

ALTER TABLE `{$prefix}massage_service_refund_order` ADD COLUMN `init` tinyint(3) DEFAULT '0';

alter table `{$prefix}massage_service_refund_order` ADD INDEX `status` (`status`) USING BTREE;


ALTER TABLE `{$prefix}massage_service_coach_level` ADD COLUMN `add_balance_status` tinyint(3) DEFAULT '0' COMMENT '加钟基础值开关';

ALTER TABLE `{$prefix}massage_service_coach_level` ADD COLUMN `add_basis_balance` decimal(10,2) DEFAULT '0.00' COMMENT '加钟基础值';

ALTER TABLE `{$prefix}massage_coach_custom_balance` ADD COLUMN `add_balance_status` tinyint(3) DEFAULT '0' COMMENT '加钟基础值开关';

ALTER TABLE `{$prefix}massage_coach_custom_balance` ADD COLUMN `add_basis_balance` decimal(10,2) DEFAULT '0.00' COMMENT '加钟基础值';

alter table `{$prefix}massage_service_order_commission` ADD INDEX `create_time` (`create_time`) USING BTREE;

alter table `{$prefix}massage_service_order_list` ADD INDEX `create_time` (`create_time`) USING BTREE;

alter table `{$prefix}massage_service_order_list` ADD INDEX `pay_time` (`pay_time`) USING BTREE;


ALTER TABLE `{$prefix}massage_agent_apply` ADD COLUMN `id_card` varchar(64) DEFAULT '' COMMENT '身份证';

ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN `login_auth_phone` varchar(32) DEFAULT '' COMMENT '代理商绑定的手机号';
ALTER TABLE `{$prefix}massage_service_coupon_record` ADD COLUMN `is_new` tinyint(3) DEFAULT '2' COMMENT '1新用户使用';

ALTER TABLE `{$prefix}massage_service_order_list` ADD COLUMN `coupon_bear_type` tinyint(3) DEFAULT '1' COMMENT '卡券承担方式';

ALTER TABLE `{$prefix}massage_config` ADD COLUMN `order_rules` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '交易须知';

ALTER TABLE `{$prefix}massage_service_order_list_data` ADD COLUMN `coupon_bear_coach` decimal(10,2) DEFAULT '0.00' COMMENT '卡券技师承担';
ALTER TABLE `{$prefix}massage_service_order_list_data` ADD COLUMN `coupon_bear_admin` decimal(10,2) DEFAULT '0.00' COMMENT '卡券带来承担';

ALTER TABLE `{$prefix}massage_aliyun_phone_config` ADD COLUMN `winnerlook_phone` varchar(32) DEFAULT '' COMMENT '云信语音通知电话';

ALTER TABLE `{$prefix}massage_service_coach_list` ADD COLUMN `version` tinyint(3) DEFAULT '0' COMMENT '版本号';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_heepay_callback` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `type` varchar(32) DEFAULT '',
  `order_id` int(11) DEFAULT NULL,
  `heepay_order_code` varchar(255) DEFAULT '',
  `text` text,
  `create_time` bigint(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_heepay_config` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `agent_id` varchar(255) DEFAULT '' COMMENT '主商户id',
  `ref_agent_id` varchar(255) DEFAULT '' COMMENT '子商户id',
  `pay_key` varchar(255) DEFAULT '' COMMENT '支付密钥',
  `public_key` text COMMENT '公钥',
  `private_key` text COMMENT '私钥',
  `appid` varchar(255) DEFAULT '' COMMENT 'appid',
  `refund_key` varchar(255) DEFAULT '' COMMENT '退款密钥',
  `status` tinyint(3) DEFAULT '0' COMMENT '是否开启汇付宝',
  `c_public_key` text COMMENT '汇付宝公钥',
  `recharge_key` varchar(255) DEFAULT '' COMMENT '转账密钥',
  `recharge_des_key` varchar(255) DEFAULT '' COMMENT '转账3DES密钥',
  `recharge_dec` varchar(255) DEFAULT '佣金转账' COMMENT '转账原因',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


CREATE TABLE IF NOT EXISTS `{$prefix}massage_heepay_recharge_record` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `apply_no` varchar(64) DEFAULT '' COMMENT '用户编号',
  `heepay_id` varchar(64) DEFAULT '' COMMENT '商户id',
  `cash` decimal(10,2) DEFAULT '0.00' COMMENT '充值金额',
  `agent_bill_id` varchar(255) DEFAULT '' COMMENT '单据号',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  `update_time` bigint(11) DEFAULT '0' COMMENT '到账时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_heepay_record_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_id` int(11) DEFAULT NULL,
  `type` varchar(32) DEFAULT '',
  `cash` decimal(10,2) DEFAULT '0.00',
  `status` tinyint(3) DEFAULT '1',
  `order_code` varchar(255) DEFAULT '',
  `heepay_order_code` varchar(255) DEFAULT '',
  `create_time` bigint(11) DEFAULT '0',
  `pay_order_id` int(11) DEFAULT '0',
  `true_price` decimal(10,2) DEFAULT '0.00',
  `pay_record_id` int(11) DEFAULT '0',
  `log_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `{$prefix}massage_heepay_user_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `apply_no` varchar(255) DEFAULT '',
  `heepay_id` varchar(255) DEFAULT '' COMMENT '商户id',
  `if_sign` tinyint(3) DEFAULT '1' COMMENT '是否签约',
  `customer_type` tinyint(3) DEFAULT '1' COMMENT '客户类型1=企业2=个体工商户3=小微商户',
  `customer_name` varchar(255) DEFAULT '' COMMENT '客户名称',
  `customer_short_name` varchar(255) DEFAULT '' COMMENT '客户简称 （微信/支付宝/银联进件简称）用于账单展示，请谨慎填写',
  `customer_phone` varchar(255) DEFAULT '' COMMENT '客服电话',
  `licence_address` varchar(255) DEFAULT '' COMMENT '营业执照注册地址',
  `licence_code` varchar(255) DEFAULT '' COMMENT '营业执照编码（统一社会信用代码）',
  `licence_valid_type` varchar(255) DEFAULT '' COMMENT '营业执照有效期类型（当licence_valid_type =2时，licence_valid_end 为空）',
  `licence_valid_begin` varchar(255) DEFAULT '' COMMENT '营业执照生效日期（yyyy-MM-dd）',
  `licence_region_code` varchar(255) DEFAULT '' COMMENT '营业执照区划编码',
  `business_category_code` varchar(255) DEFAULT '' COMMENT '经营类目编码，参见附录',
  `manage_name` varchar(255) DEFAULT '' COMMENT '经营者姓名',
  `manage_id_card` varchar(255) DEFAULT '' COMMENT '经营者证件号',
  `manage_id_card_valid_begin` varchar(255) DEFAULT '' COMMENT '经营者证件生效日期（yyyy-MM-dd）',
  `manage_id_card_valid_type` varchar(255) DEFAULT '' COMMENT '经营者证件有效期类型（当manage_id_card_type =2时，manage_id_card_valid_end 为空）',
  `manage_mobile` varchar(255) DEFAULT '' COMMENT '经营者手机号',
  `manage_region_code` varchar(255) DEFAULT '' COMMENT '经营者区划编码',
  `contact_name` varchar(255) DEFAULT '' COMMENT '业务联系人名称',
  `contact_id_card` varchar(255) DEFAULT '' COMMENT '业务联系人证件号',
  `contact_id_card_valid_type` varchar(255) DEFAULT '' COMMENT '业务联系人证件有效期类型',
  `contact_id_card_valid_begin` varchar(255) DEFAULT '' COMMENT '业务联系人证件生效日期（yyyy-MM-dd）',
  `contact_mobile` varchar(255) DEFAULT '' COMMENT '业务联系人手机号',
  `contact_email` varchar(255) DEFAULT '' COMMENT '业务联系人邮箱/创建商户登录账号',
  `bank_account_type` varchar(255) DEFAULT '' COMMENT '结算银行账户类型',
  `bank_account_name` varchar(255) DEFAULT '' COMMENT '结算银行账户名称',
  `bank_card_no` varchar(255) DEFAULT '' COMMENT '结算银行卡号',
  `bank_name` varchar(255) DEFAULT '' COMMENT '结算开户行名称',
  `bank_region_code` varchar(255) DEFAULT '' COMMENT '结算银行所属区划编码',
  `licence_img` varchar(255) DEFAULT '' COMMENT '营业执照图片路径',
  `company_build_img` varchar(255) DEFAULT '' COMMENT '公司大楼图片路径',
  `company_front_img` varchar(255) DEFAULT '' COMMENT '公司前台图片路径',
  `shop_env_img` varchar(255) DEFAULT '' COMMENT '店内场景照图片路径 ，收单户必填，钱包户选填',
  `shop_cashier_img` varchar(255) DEFAULT '' COMMENT '收银台图片路径，收单户必填，钱包户选填',
  `shop_front_img` varchar(255) DEFAULT '' COMMENT '门头照图片路径 ，收单户必填，钱包户选填',
  `manage_id_card_front_img` varchar(255) DEFAULT '' COMMENT '经营者身份证人像面图片路径',
  `manage_id_card_back_img` varchar(255) DEFAULT '' COMMENT '经营者身份证国徽面图片路径',
  `manage_hold_id_card_front_img` varchar(255) DEFAULT '' COMMENT '经营者手持身份证正面图片路径',
  `manage_hold_bank_front_img` varchar(255) DEFAULT '' COMMENT '经营者手持银行卡卡号面图片路径',
  `contact_id_card_front_img` varchar(255) DEFAULT '' COMMENT '业务联系人身份证人像面图片路径',
  `contact_id_card_back_img` varchar(255) DEFAULT '' COMMENT '业务联系人身份证国徽面图片路径',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  `bank_back_img` varchar(255) DEFAULT '',
  `bank_front_img` varchar(255) DEFAULT '',
  `bank_owner_hold_img` varchar(255) DEFAULT '',
  `contact_id_card_valid_end` varchar(255) DEFAULT '',
  `manage_id_card_valid_end` varchar(255) DEFAULT '',
  `legal_id_card_valid_end` varchar(255) DEFAULT '',
  `legal_id_card` varchar(255) DEFAULT '',
  `legal_id_card_back_img` varchar(255) DEFAULT '',
  `legal_id_card_front_img` varchar(255) DEFAULT '',
  `legal_id_card_valid_begin` varchar(255) DEFAULT '',
  `legal_id_card_valid_type` varchar(255) DEFAULT '',
  `legal_mobile` varchar(32) DEFAULT '',
  `legal_name` varchar(255) DEFAULT '',
  `contact_name:` varchar(255) DEFAULT '',
  `licence_valid_end` varchar(255) DEFAULT NULL,
  `manage_detail_address` varchar(255) DEFAULT '',
  `reg_certificate_img` varchar(255) DEFAULT '',
  `audit_status` int(11) DEFAULT '0' COMMENT '-2=入驻图片驳回,-1=入驻驳回,0=入驻待审核,1=入驻审核中,2=业务开通中,3=商户启用,4=补充材料',
  `reject_reason` varchar(255) DEFAULT '',
  `bank_region_code_data` varchar(255) DEFAULT '',
  `manage_region_code_data` varchar(255) DEFAULT '',
  `licence_region_code_data` varchar(255) DEFAULT '',
  `register_type` varchar(255) DEFAULT 'HEEPAY_BALANCE',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN `coach_cash_auth` tinyint(3) DEFAULT '0' COMMENT '修改技师余额权限';

CREATE TABLE IF NOT EXISTS `{$prefix}massage_admin_update_coachcash_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `admin_id` int(11) DEFAULT '0' COMMENT '代理商id',
  `coach_id` int(11) DEFAULT '0' COMMENT '技师id',
  `cash` decimal(10,2) DEFAULT '0.00' COMMENT '修改金额',
  `is_add` tinyint(3) DEFAULT '1' COMMENT '1扣技师余额 2加技师余额',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  `record_id` int(11) DEFAULT '0',
  `create_user_id` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='代理商修改技师余额记录';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_admin_recharge_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `admin_id` int(11) DEFAULT '0' COMMENT '代理商id',
  `order_code` varchar(64) DEFAULT '' COMMENT '订单号',
  `transaction_id` varchar(64) DEFAULT '' COMMENT '商户订单号',
  `pay_type` tinyint(3) DEFAULT '1' COMMENT '支付状态2支付',
  `cash` decimal(10,2) DEFAULT '0.00' COMMENT '充值金额',
  `create_time` bigint(11) DEFAULT '0' COMMENT '充值时间',
  `pay_time` bigint(11) DEFAULT '0' COMMENT '支付时间',
  `pay_model` int(3) DEFAULT '1' COMMENT '支付方式',
  `create_user_id` int(11) DEFAULT '0' COMMENT '充值人id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='代理商充值记录';



CREATE TABLE IF NOT EXISTS `{$prefix}massage_nopay_record` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0' COMMENT '用户id',
  `coach_id` int(11) DEFAULT '0' COMMENT '技师id',
  `status` tinyint(3) DEFAULT '1',
  `create_time` bigint(11) DEFAULT '0',
  `have_notice` tinyint(3) DEFAULT '0' COMMENT '是否已经通知',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='未付款记录';


CREATE TABLE IF NOT EXISTS `{$prefix}massage_nopay_record_goods` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `record_id` int(11) DEFAULT '0' COMMENT '记录id',
  `goods_id` int(11) DEFAULT '0' COMMENT '服务id',
  `goods_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '' COMMENT '服务名称',
  `goods_cover` varchar(255) DEFAULT '' COMMENT '服务封面',
  `goods_price` decimal(10,2) DEFAULT '0.00' COMMENT '服务价格',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='未付款订单记录商品';

ALTER TABLE `{$prefix}massage_coach_cash_update_record` ADD COLUMN `admin_type` int(11) DEFAULT '0' COMMENT '代理商的时候 0普通修改 -1充值 1技师服务费 2技师车费 3代理商 4分销员 5渠道商 6业务员';

ALTER TABLE `{$prefix}massage_coach_cash_update_record` ADD COLUMN `admin_update_id` int(11) DEFAULT '0' COMMENT '代理商修改的对象id';

ALTER TABLE `{$prefix}massage_service_refund_order` ADD COLUMN `is_admin` tinyint(3) DEFAULT '0';

alter table `{$prefix}massage_service_user_list` ADD INDEX `create_time` (`create_time`) USING BTREE;

alter table `{$prefix}massage_service_coupon_record` ADD INDEX `coupon_id` (`coupon_id`) USING BTREE;

alter table `{$prefix}massage_service_coupon_record` ADD INDEX `user_id` (`user_id`) USING BTREE;

ALTER TABLE `{$prefix}massage_coach_cash_update_record` ADD COLUMN `ip` varchar(64) DEFAULT '';

ALTER TABLE `{$prefix}massage_send_msg_config` ADD COLUMN `coupon_notice_tmpl_id` varchar(225) DEFAULT '' COMMENT '卡券通知模版id';

ALTER TABLE `{$prefix}massage_send_msg_config` modify COLUMN `coupon_notice_tmpl_id` varchar(225) DEFAULT '' COMMENT '卡券通知模版id';


ALTER TABLE `{$prefix}massage_order_control_log` ADD COLUMN `old_mobile` varchar(32) DEFAULT '' COMMENT '原来的手机号';

ALTER TABLE `{$prefix}massage_service_order_commission_share` ADD COLUMN `status` tinyint(3) DEFAULT '2';

CREATE TABLE IF NOT EXISTS `{$prefix}massage_coach_update_address_record` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `order_id` int(11) DEFAULT '0',
  `address` varchar(255) DEFAULT '' COMMENT '地址',
  `address_info` varchar(255) DEFAULT '' COMMENT '详细地址',
  `lng` varchar(32) DEFAULT '',
  `lat` varchar(32) DEFAULT '',
  `create_time` bigint(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  `log_id` int(11) DEFAULT '0' COMMENT '订单日志id',
  `city` varchar(64) DEFAULT '' COMMENT '城市名字',
  `area` varchar(64) DEFAULT '' COMMENT '区县',
  `province` varchar(32) DEFAULT '' COMMENT '省',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='技师修改订单地址记录';

ALTER TABLE `{$prefix}massage_distribution_list` ADD COLUMN `recommend_cash` decimal(10,2) DEFAULT '0.00' COMMENT '分销员推荐费';

ALTER TABLE `{$prefix}massage_distribution_list` ADD COLUMN `recommend_range` tinyint(3) DEFAULT '1' COMMENT '1分销员同城市 2平台开放城市 3不限';

ALTER TABLE `{$prefix}massage_distribution_list` ADD COLUMN `recommend_day` int(11) DEFAULT '0' COMMENT '返佣时效';

ALTER TABLE `{$prefix}massage_distribution_list` ADD COLUMN `recommend_time` bigint(11) DEFAULT '0' COMMENT '最后一次编辑推荐费的时间';

CREATE TABLE IF NOT EXISTS `{$prefix}massage_reseller_recommend_cash` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `reseller_id` int(11) DEFAULT '0' COMMENT '分销员id',
  `user_id` int(11) DEFAULT '0' COMMENT '用户id',
  `recommend_cash` decimal(10,2) DEFAULT '0.00' COMMENT '推荐费',
  `create_time` bigint(11) DEFAULT '0',
  `status` tinyint(3) DEFAULT '1',
  `province` varchar(64) DEFAULT '' COMMENT '省',
  `city` varchar(64) DEFAULT '' COMMENT '市',
  `area` varchar(64) DEFAULT '' COMMENT '区',
  `point_cash` decimal(10,2) DEFAULT '0.00' COMMENT '手续费',
  `point_balance` decimal(10,2) DEFAULT '0.00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='分销员推荐费';


alter table `{$prefix}massage_service_refund_order_goods` ADD INDEX `refund_id` (`refund_id`) USING BTREE;

alter table `{$prefix}massage_service_coupon_record` ADD INDEX `order_id` (`order_id`) USING BTREE;

alter table `{$prefix}massage_service_order_commission_share` ADD INDEX `comm_type` (`comm_type`) USING BTREE;

alter table `{$prefix}massage_service_order_commission_share` ADD INDEX `cash_type` (`cash_type`) USING BTREE;

alter table `{$prefix}massage_service_order_commission` ADD INDEX `broker_id` (`broker_id`) USING BTREE;

alter table `{$prefix}massage_service_user_list` ADD INDEX `uniacid` (`uniacid`) USING BTREE;

alter table `{$prefix}massage_service_order_list` ADD INDEX `user_id` (`user_id`) USING BTREE;
ALTER TABLE `{$prefix}massage_distribution_list` ADD COLUMN `true_user_name` varchar(64) DEFAULT '' COMMENT '真实姓名';
ALTER TABLE `{$prefix}massage_channel_list` ADD COLUMN `true_user_name` varchar(64) DEFAULT '' COMMENT '真实姓名';
ALTER TABLE `{$prefix}massage_service_coach_list` ADD COLUMN `true_user_name` varchar(64) DEFAULT '' COMMENT '真实姓名';
ALTER TABLE `{$prefix}massage_salesman_list` ADD COLUMN `true_user_name` varchar(64) DEFAULT '' COMMENT '真实姓名';
ALTER TABLE `{$prefix}massage_coach_broker_list` ADD COLUMN `true_user_name` varchar(64) DEFAULT '' COMMENT '真实姓名';
ALTER TABLE `{$prefix}massage_service_coach_update` ADD COLUMN `true_user_name` varchar(64) DEFAULT '' COMMENT '真实姓名';
ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN `offline_transfer_auth` tinyint(3) DEFAULT '1' COMMENT '线下转账';
ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN `wechat_transfer_auth` tinyint(3) DEFAULT '0' COMMENT '微信转账';
ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN `alipay_transfer_auth` tinyint(3) DEFAULT '0' COMMENT '支付宝转账';
ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN `bank_transfer_auth` tinyint(3) DEFAULT '0' COMMENT '银行卡转账';
ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN `recommend_cash_auth` tinyint(3) DEFAULT '0' COMMENT '分销员推荐费';

ALTER TABLE `{$prefix}massage_reseller_recommend_cash` ADD COLUMN `admin_id` int(11) DEFAULT '0' COMMENT '代理商id';

alter table `{$prefix}massage_channel_scan_code_record` ADD INDEX `type` (`type`) USING BTREE;
alter table `{$prefix}massage_channel_scan_code_record` ADD INDEX `user_id` (`user_id`) USING BTREE;
alter table `{$prefix}massage_channel_scan_code_record` ADD INDEX `qr_id` (`qr_id`) USING BTREE;
alter table `{$prefix}massage_channel_scan_code_record` ADD INDEX `is_new` (`is_new`) USING BTREE;
alter table `{$prefix}massage_service_refund_order` ADD INDEX `order_id` (`order_id`) USING BTREE;

ALTER TABLE `{$prefix}massage_reseller_recommend_cash` ADD COLUMN `err_type` int(11) DEFAULT '1' COMMENT '错误类型 1时间过期 2和代理商不同地区 3和平台不同地区  4代理商钱不够扣';

ALTER TABLE `{$prefix}massage_service_user_list` ADD COLUMN  `admin_id` int(11) DEFAULT '0' COMMENT '代理商id';

CREATE TABLE IF NOT EXISTS `{$prefix}massage_coach_notice` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '' COMMENT '标题',
  `text` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '内容',
  `status` tinyint(3) DEFAULT '1',
  `create_user` int(11) DEFAULT '0' COMMENT '创建人',
  `create_time` bigint(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='技师公告';

ALTER TABLE `{$prefix}massage_agent_apply` ADD COLUMN `admin_pid` int(11) DEFAULT '0' COMMENT '邀请代理商id';

ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN `sub_agent_auth` tinyint(3) DEFAULT '1' COMMENT '发展下级代理商的权限';

ALTER TABLE `{$prefix}shequshop_school_admin` ADD COLUMN `agent_coach_auth` tinyint(3) DEFAULT '1' COMMENT '发展技师的权限';

ALTER TABLE `{$prefix}massage_channel_scan_code_record` ADD COLUMN `admin_id` int(11) DEFAULT '0' COMMENT '代理商id';

ALTER TABLE `{$prefix}massage_action_log` ADD COLUMN `text` text;

alter table `{$prefix}massage_distribution_list` ADD INDEX `user_id` (`user_id`) USING BTREE;
alter table `{$prefix}massage_service_wallet_list` ADD INDEX `user_id` (`user_id`) USING BTREE;
alter table `{$prefix}massage_service_wallet_list` ADD INDEX `coach_id` (`coach_id`) USING BTREE;
alter table `{$prefix}massage_service_wallet_list` ADD INDEX `status` (`status`) USING BTREE;
alter table `{$prefix}massage_service_order_commission_share` ADD INDEX `type` (`type`) USING BTREE;


updateSql;


return $sql;